Skip to content

Instantly share code, notes, and snippets.

Created May 10, 2010 19:27
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save anonymous/396414 to your computer and use it in GitHub Desktop.
Save anonymous/396414 to your computer and use it in GitHub Desktop.
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