mirror of
https://github.com/discourse/discourse.git
synced 2025-08-21 19:11:18 +08:00
FIX: PNG-to-JPEG conversion should only be done to images with at least 1 megapixels
This commit is contained in:
parent
832d621b48
commit
062158a25e
1 changed files with 3 additions and 1 deletions
|
@ -122,9 +122,11 @@ class UploadCreator
|
|||
end
|
||||
end
|
||||
|
||||
MIN_PIXELS_TO_CONVERT_TO_JPEG ||= 1280 * 720
|
||||
|
||||
def should_convert_to_jpeg?
|
||||
TYPES_CONVERTED_TO_JPEG.include?(@image_info.type) &&
|
||||
@image_info.size.min > 720 &&
|
||||
pixels > MIN_PIXELS_TO_CONVERT_TO_JPEG &&
|
||||
SiteSetting.png_to_jpg_quality < 100
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue