diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-05-12 11:03:05 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2021-05-12 11:03:05 +0200 |
commit | dc58d02192baef0bd006d80f10f018f01dc5ff0f (patch) | |
tree | ae1e316aa745d8c28551bf418ad6d47bc83c55a4 /lib/paperclip/gif_transcoder.rb | |
parent | ffc3f8eebe134ca9b18af73aa29eaa1627082e40 (diff) | |
parent | 70f6f2e9b70afe5af17ee9aaec777565bdef8aed (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'lib/paperclip/gif_transcoder.rb')
-rw-r--r-- | lib/paperclip/gif_transcoder.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/paperclip/gif_transcoder.rb b/lib/paperclip/gif_transcoder.rb index 74aa1a0b2..d14465c01 100644 --- a/lib/paperclip/gif_transcoder.rb +++ b/lib/paperclip/gif_transcoder.rb @@ -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 |