Skip to content
Snippets Groups Projects
Unverified Commit 5ed5f627 authored by rinsuki's avatar rinsuki Committed by GitHub
Browse files

Fix animated GIF generates animated thumbnail (#16216)

parent be353bcc
No related branches found
No related tags found
No related merge requests found
......@@ -108,9 +108,11 @@ module Paperclip
final_file = Paperclip::Transcoder.make(file, options, attachment)
attachment.instance.file_file_name = File.basename(attachment.instance.file_file_name, '.*') + '.mp4'
attachment.instance.file_content_type = 'video/mp4'
attachment.instance.type = MediaAttachment.types[:gifv]
if options[:style] == :original
attachment.instance.file_file_name = File.basename(attachment.instance.file_file_name, '.*') + '.mp4'
attachment.instance.file_content_type = 'video/mp4'
attachment.instance.type = MediaAttachment.types[:gifv]
end
final_file
end
......@@ -118,7 +120,7 @@ module Paperclip
private
def needs_convert?
options[:style] == :original && GifReader.animated?(file.path)
GifReader.animated?(file.path)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment