mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
new 'convert_pasted_images_quality' site setting
This commit is contained in:
parent
be099bb637
commit
6dac9075dc
3 changed files with 6 additions and 1 deletions
|
@ -73,7 +73,7 @@ class UploadsController < ApplicationController
|
|||
# convert pasted images to HQ jpegs
|
||||
if filename == "blob.png" && SiteSetting.convert_pasted_images_to_hq_jpg
|
||||
jpeg_path = "#{File.dirname(tempfile.path)}/blob.jpg"
|
||||
`convert #{tempfile.path} -quality 95 #{jpeg_path}`
|
||||
`convert #{tempfile.path} -quality #{SiteSetting.convert_pasted_images_quality} #{jpeg_path}`
|
||||
# only change the format of the image when JPG is at least 5% smaller
|
||||
if File.size(jpeg_path) < File.size(tempfile.path) * 0.95
|
||||
filename = "blob.jpg"
|
||||
|
|
|
@ -1070,6 +1070,7 @@ en:
|
|||
allow_all_attachments_for_group_messages: "Allow all email attachments for group messages."
|
||||
|
||||
convert_pasted_images_to_hq_jpg: "Convert pasted images to high-quality JPG files."
|
||||
convert_pasted_images_quality: "Quality of the converted JPG file (1 is lowest quality, 100 is best quality)."
|
||||
|
||||
enable_flash_video_onebox: "Enable embedding of swf and flv (Adobe Flash) links in oneboxes. WARNING: may introduce security risks."
|
||||
|
||||
|
|
|
@ -718,6 +718,10 @@ files:
|
|||
default_opengraph_image_url: ''
|
||||
allow_all_attachments_for_group_messages: false
|
||||
convert_pasted_images_to_hq_jpg: true
|
||||
convert_pasted_images_quality:
|
||||
default: 95
|
||||
min: 1
|
||||
max: 100
|
||||
|
||||
trust:
|
||||
default_trust_level:
|
||||
|
|
Loading…
Reference in a new issue