Skip to content

Commit 1c9c741

Browse files
committed
Readds auto-rotate option
1 parent 46f8a9c commit 1c9c741

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/paperclip/paperclip_processors/transcoder.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ def make
5656
if output_is_image?
5757
@time = @time.call(@meta, @options) if @time.respond_to?(:call)
5858
@cli.filter_seek @time
59+
60+
if @auto_rotate && !@meta[:rotate].nil?
61+
log "Adding rotation #{@meta[:rotate]}"
62+
case @meta[:rotate]
63+
when 90
64+
@convert_options[:output][:vf] = "'transpose=1'"
65+
when 180
66+
@convert_options[:output][:vf] = "'vflip, hflip'"
67+
when 270
68+
@convert_options[:output][:vf] = "'transpose=2'"
69+
end
70+
end
5971
end
6072

6173
if @convert_options.present?

0 commit comments

Comments
 (0)