mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +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
|
@ -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…
Reference in New Issue
Block a user