0
0
Fork 0

Fix performance of GIF re-encoding (#12057)

* 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
This commit is contained in:
Eugen Rochko 2019-10-03 01:09:12 +02:00 committed by GitHub
parent 0ce0baa9b5
commit ca22a22d7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 128 additions and 12 deletions

View file

@ -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