mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
FIX: Do not optimize animated images in cooked posts (#11214)
CookedPostProcessor replaces all large images with their optimized versions, but for GIF images the optimized version is limited to first frame only. This caused animations it cooked posts to require a click to show up the lightbox and start playing.
This commit is contained in:
@ -384,7 +384,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.thumbnail(w, h)
|
||||
thumbnail = !upload.animated && upload.thumbnail(w, h)
|
||||
if thumbnail && thumbnail.filesize.to_i < upload.filesize
|
||||
img["src"] = thumbnail.url
|
||||
|
||||
|
Reference in New Issue
Block a user