Skip to content

Instantly share code, notes, and snippets.

@Nilloc
Forked from anonymous/auto_orient.rb
Created August 13, 2011 20:32
Show Gist options
  • Save Nilloc/1144220 to your computer and use it in GitHub Desktop.
Save Nilloc/1144220 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