mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:21:23 +08:00
FIX: Change max_image_megapixels logic (#25625)
This commit changes `max_image_megapixels` to be used as is without multiplying by 2 to give extra leway. We found in reality this was just causing confusion for admins, especially with the already permissive 40MP default.
This commit is contained in:
@ -301,12 +301,12 @@ class UploadCreator
|
||||
@upload.errors.add(:base, I18n.t("upload.empty"))
|
||||
elsif pixels == 0 && @image_info.type.to_s != "svg"
|
||||
@upload.errors.add(:base, I18n.t("upload.images.size_not_found"))
|
||||
elsif max_image_pixels > 0 && pixels >= max_image_pixels * 2
|
||||
elsif max_image_pixels > 0 && pixels >= max_image_pixels
|
||||
@upload.errors.add(
|
||||
:base,
|
||||
I18n.t(
|
||||
"upload.images.larger_than_x_megapixels",
|
||||
max_image_megapixels: SiteSetting.max_image_megapixels * 2,
|
||||
max_image_megapixels: SiteSetting.max_image_megapixels,
|
||||
),
|
||||
)
|
||||
end
|
||||
|
Reference in New Issue
Block a user