-
-
Save kylebragger/667289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Paperclip | |
class AutoOrient < Paperclip::Processor | |
def initialize(file, options = {}, *args) | |
@file = file | |
end | |
def make( *args ) | |
dst = Tempfile.new([@basename, @format].compact.join(".")) | |
dst.binmode | |
Paperclip.run('convert',"#{File.expand_path(@file.path)} -auto-orient #{File.expand_path(dst.path)}") | |
return dst | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment