Guest User

Untitled

a guest
Jun 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. module Paperclip
  2. class AutoOrient < Paperclip::Processor
  3. def initialize(file, options = {}, *args)
  4. @file = file
  5. end
  6.  
  7. def make( *args )
  8. dst = Tempfile.new([@basename, @format].compact.join("."))
  9. dst.binmode
  10.  
  11. Paperclip.run('convert',"#{File.expand_path(@file.path)} -auto-orient #{File.expand_path(dst.path)}")
  12.  
  13. return dst
  14. end
  15. end
  16. end
Add Comment
Please, Sign In to add comment