about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorEugen <eugen@zeonfederated.com>2017-04-19 23:21:00 +0200
committerGitHub <noreply@github.com>2017-04-19 23:21:00 +0200
commit2e4afccd9d5327c072cf0a0fe5d4c6e97ecc10cf (patch)
tree1f7c6a8b165d65b1d50f635af683251400c9ce34 /lib
parent0876a06e4544bc0946f3f6d884c7e2507ee12def (diff)
Fix #2108 - Fix gif uploads (#2171)
* Fix #2108 - Fix gif uploads
Add specs for media attachment gifv conversion

* Add ffmpeg to travis

* Make travis install ffmpeg, not libav

* Switch travis to trusty
Diffstat (limited to 'lib')
-rw-r--r--lib/paperclip/gif_transcoder.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/paperclip/gif_transcoder.rb b/lib/paperclip/gif_transcoder.rb
index 8337448b2..cbe53b27b 100644
--- a/lib/paperclip/gif_transcoder.rb
+++ b/lib/paperclip/gif_transcoder.rb
@@ -7,7 +7,11 @@ module Paperclip
     def make
       num_frames = identify('-format %n :file', file: file.path).to_i
 
-      return file unless options[:style] == :original && num_frames > 1
+      unless options[:style] == :original && num_frames > 1
+        tmp_file = Paperclip::TempfileFactory.new.generate(attachment.instance.file_file_name)
+        tmp_file << file.read
+        return tmp_file
+      end
 
       final_file = Paperclip::Transcoder.make(file, options, attachment)