Class: Paperclip::AutoOrient

Inherits:
Processor
  • Object
show all
Defined in:
lib/paperclip/auto_orient.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}, *args) ⇒ AutoOrient

Returns a new instance of AutoOrient.



5
6
7
# File 'lib/paperclip/auto_orient.rb', line 5

def initialize(file, options = {}, *args)
  @file = file
end

Instance Method Details

#make(*args) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/paperclip/auto_orient.rb', line 9

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