diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-10-03 01:09:12 +0200 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-21 03:59:44 -0600 |
commit | 5b6fc19e76b1b9af5c8ed1ebfa664606d2170e82 (patch) | |
tree | b6ae2469304fbdec0ce5a75796b1fb0863fba155 /lib/paperclip/video_transcoder.rb | |
parent | 941c1d41ffebfcd96d6709219c50b1482f930e9b (diff) |
port tootsuite#12057 to monsterfork: Fix performance of GIF re-encoding
* Change animated GIF detection to not shell out to ImageMagick Signed-off-by: Eugen Rochko <eugen@zeonfederated.com> * Change video encoding parameters to limit to 10800 video frames Signed-off-by: Eugen Rochko <eugen@zeonfederated.com> * Limit GIF image size further Signed-off-by: Eugen Rochko <eugen@zeonfederated.com> * Always strip metadata from video files * Fix code style issues
Diffstat (limited to 'lib/paperclip/video_transcoder.rb')
-rw-r--r-- | lib/paperclip/video_transcoder.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/paperclip/video_transcoder.rb b/lib/paperclip/video_transcoder.rb index c3504c17c..66f7feda5 100644 --- a/lib/paperclip/video_transcoder.rb +++ b/lib/paperclip/video_transcoder.rb @@ -6,7 +6,9 @@ module Paperclip class VideoTranscoder < Paperclip::Processor def make meta = ::Av.cli.identify(@file.path) + attachment.instance.type = MediaAttachment.types[:gifv] unless meta[:audio_encode] + options[:format] = File.extname(attachment.instance.file_file_name)[1..-1] if options[:keep_same_format] Paperclip::Transcoder.make(file, options, attachment) end |