mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:14:12 +08:00
FIX: Disable lightboxing of animated images (#13099)
This commit is contained in:
@ -353,13 +353,13 @@ class CookedPostProcessor
|
||||
unless @disable_loading_image
|
||||
upload.create_thumbnail!(LOADING_SIZE, LOADING_SIZE, format: 'png', colors: LOADING_COLORS)
|
||||
end
|
||||
end
|
||||
|
||||
if img.ancestors('.onebox, .onebox-body, .quote').blank? && !img.classes.include?("onebox")
|
||||
add_lightbox!(img, original_width, original_height, upload, cropped: crop)
|
||||
end
|
||||
return if upload.animated?
|
||||
|
||||
if img.ancestors('.onebox, .onebox-body, .quote').blank? && !img.classes.include?("onebox")
|
||||
add_lightbox!(img, original_width, original_height, upload, cropped: crop)
|
||||
end
|
||||
|
||||
if upload.present?
|
||||
optimize_image!(img, upload, cropped: crop)
|
||||
end
|
||||
end
|
||||
@ -390,7 +390,7 @@ class CookedPostProcessor
|
||||
w, h = img["width"].to_i, img["height"].to_i
|
||||
|
||||
# note: optimize_urls cooks the src and data-small-upload further after this
|
||||
thumbnail = !upload.animated && upload.thumbnail(w, h)
|
||||
thumbnail = upload.thumbnail(w, h)
|
||||
if thumbnail && thumbnail.filesize.to_i < upload.filesize
|
||||
img["src"] = thumbnail.url
|
||||
|
||||
|
Reference in New Issue
Block a user