Skip to content

Instantly share code, notes, and snippets.

@kylebragger
Forked from anonymous/auto_orient.rb
Created November 8, 2010 01:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylebragger/667289 to your computer and use it in GitHub Desktop.
Save kylebragger/667289 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