From 1c9c74136016044bdc9a95db35d078a05b95ea84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Costa?= Date: Sun, 13 Dec 2015 22:34:58 +0000 Subject: [PATCH 1/2] Readds auto-rotate option --- lib/paperclip/paperclip_processors/transcoder.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/paperclip/paperclip_processors/transcoder.rb b/lib/paperclip/paperclip_processors/transcoder.rb index 36b3f88..d191ce6 100755 --- a/lib/paperclip/paperclip_processors/transcoder.rb +++ b/lib/paperclip/paperclip_processors/transcoder.rb @@ -56,6 +56,18 @@ def make if output_is_image? @time = @time.call(@meta, @options) if @time.respond_to?(:call) @cli.filter_seek @time + + if @auto_rotate && !@meta[:rotate].nil? + log "Adding rotation #{@meta[:rotate]}" + case @meta[:rotate] + when 90 + @convert_options[:output][:vf] = "'transpose=1'" + when 180 + @convert_options[:output][:vf] = "'vflip, hflip'" + when 270 + @convert_options[:output][:vf] = "'transpose=2'" + end + end end if @convert_options.present? From 98783a03641d143605e7d88382e0f077048c21e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Costa?= Date: Mon, 14 Dec 2015 12:01:29 +0000 Subject: [PATCH 2/2] Uses av filter_rotate instead --- lib/paperclip/paperclip_processors/transcoder.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/lib/paperclip/paperclip_processors/transcoder.rb b/lib/paperclip/paperclip_processors/transcoder.rb index d191ce6..d67efea 100755 --- a/lib/paperclip/paperclip_processors/transcoder.rb +++ b/lib/paperclip/paperclip_processors/transcoder.rb @@ -56,18 +56,7 @@ def make if output_is_image? @time = @time.call(@meta, @options) if @time.respond_to?(:call) @cli.filter_seek @time - - if @auto_rotate && !@meta[:rotate].nil? - log "Adding rotation #{@meta[:rotate]}" - case @meta[:rotate] - when 90 - @convert_options[:output][:vf] = "'transpose=1'" - when 180 - @convert_options[:output][:vf] = "'vflip, hflip'" - when 270 - @convert_options[:output][:vf] = "'transpose=2'" - end - end + @cli.filter_rotate @meta[:rotate] if @auto_rotate && !@meta[:rotate].nil? end if @convert_options.present?