mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 13:21:01 +08:00
FEATURE: Allow pausing animated images in posts (#12795)
Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
@ -318,6 +318,12 @@ class CookedPostProcessor
|
||||
return
|
||||
end
|
||||
|
||||
upload = Upload.get_from_url(src)
|
||||
|
||||
if upload.present? && upload.animated?
|
||||
img.add_class("animated")
|
||||
end
|
||||
|
||||
return if original_width <= SiteSetting.max_image_width && original_height <= SiteSetting.max_image_height
|
||||
|
||||
user_width, user_height = [original_width, original_height] if user_width.to_i <= 0 && user_height.to_i <= 0
|
||||
@ -332,7 +338,6 @@ class CookedPostProcessor
|
||||
width, height = ImageSizer.resize(width, height)
|
||||
end
|
||||
|
||||
upload = Upload.get_from_url(src)
|
||||
if upload.present?
|
||||
upload.create_thumbnail!(width, height, crop: crop)
|
||||
|
||||
|
Reference in New Issue
Block a user