From 9686ae7060c4adbc199c0f31b55307e94aed31f4 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 1 Apr 2025 10:53:49 +0200 Subject: [PATCH] Fix static version of animated PNG emojis not being properly extracted (#34337) --- lib/paperclip/vips_lazy_thumbnail.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/paperclip/vips_lazy_thumbnail.rb b/lib/paperclip/vips_lazy_thumbnail.rb index fea4b86064..528d5604dc 100644 --- a/lib/paperclip/vips_lazy_thumbnail.rb +++ b/lib/paperclip/vips_lazy_thumbnail.rb @@ -123,7 +123,14 @@ module Paperclip end def needs_convert? - needs_different_geometry? || needs_different_format? || needs_metadata_stripping? + strip_animations? || needs_different_geometry? || needs_different_format? || needs_metadata_stripping? + end + + def strip_animations? + # Detecting whether the source image is animated across all our supported + # input file formats is not trivial, and converting unconditionally is just + # as simple for now + options[:style] == :static end def needs_different_geometry?