Support animated PNGs in media attachments (#28516)
This commit is contained in:
parent
39364346bb
commit
a70ae28644
11 changed files with 123 additions and 183 deletions
|
@ -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 -depth 8 RGB:-', source: File.expand_path(@file.path)).unpack('C*')
|
||||
pixels = convert(':source -flatten -depth 8 -compress none RGB:-', source: File.expand_path(@file.path)).unpack('C*')
|
||||
geometry = options.fetch(:file_geometry_parser).from_file(@file)
|
||||
[geometry.width, geometry.height, pixels]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue