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:
Bianca Nenciu
2020-11-12 21:47:30 +02:00
committed by GitHub
parent e1fbd56f6f
commit e98c7b15d6
2 changed files with 14 additions and 1 deletions

View File

@ -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