]> cat aescling's git repositories - mastodon.git/blob - lib/paperclip/video_transcoder.rb
Fix performance of GIF re-encoding (#12057)
[mastodon.git] / lib / paperclip / video_transcoder.rb
1 # frozen_string_literal: true
2
3 module Paperclip
4 # This transcoder is only to be used for the MediaAttachment model
5 # to check when uploaded videos are actually gifv's
6 class VideoTranscoder < Paperclip::Processor
7 def make
8 meta = ::Av.cli.identify(@file.path)
9
10 attachment.instance.type = MediaAttachment.types[:gifv] unless meta[:audio_encode]
11 options[:format] = File.extname(attachment.instance.file_file_name)[1..-1] if options[:keep_same_format]
12
13 Paperclip::Transcoder.make(file, options, attachment)
14 end
15 end
16 end
This page took 0.054153 seconds and 5 git commands to generate.