Fix animated GIF generates animated thumbnail (#16216)
This commit is contained in:
parent
be353bccbb
commit
5ed5f62705
1 changed files with 6 additions and 4 deletions
|
@ -108,9 +108,11 @@ module Paperclip
|
||||||
|
|
||||||
final_file = Paperclip::Transcoder.make(file, options, attachment)
|
final_file = Paperclip::Transcoder.make(file, options, attachment)
|
||||||
|
|
||||||
attachment.instance.file_file_name = File.basename(attachment.instance.file_file_name, '.*') + '.mp4'
|
if options[:style] == :original
|
||||||
attachment.instance.file_content_type = 'video/mp4'
|
attachment.instance.file_file_name = File.basename(attachment.instance.file_file_name, '.*') + '.mp4'
|
||||||
attachment.instance.type = MediaAttachment.types[:gifv]
|
attachment.instance.file_content_type = 'video/mp4'
|
||||||
|
attachment.instance.type = MediaAttachment.types[:gifv]
|
||||||
|
end
|
||||||
|
|
||||||
final_file
|
final_file
|
||||||
end
|
end
|
||||||
|
@ -118,7 +120,7 @@ module Paperclip
|
||||||
private
|
private
|
||||||
|
|
||||||
def needs_convert?
|
def needs_convert?
|
||||||
options[:style] == :original && GifReader.animated?(file.path)
|
GifReader.animated?(file.path)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue