0
0
Fork 0

Revert "Support animated PNGs in media attachments (#28516)" (#33334)

This commit is contained in:
Claire 2024-12-17 11:52:59 +01:00 committed by GitHub
parent 02748f172d
commit 1712543c68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 183 additions and 123 deletions

View file

@ -23,7 +23,7 @@ module Paperclip
image = Vips::Image.thumbnail(@file.path, 100)
[image.width, image.height, image.colourspace(:srgb).extract_band(0, n: 3).to_a.flatten]
else
pixels = convert(':source -flatten -depth 8 -compress none RGB:-', source: File.expand_path(@file.path)).unpack('C*')
pixels = convert(':source -depth 8 RGB:-', source: File.expand_path(@file.path)).unpack('C*')
geometry = options.fetch(:file_geometry_parser).from_file(@file)
[geometry.width, geometry.height, pixels]
end