Class: Paperclip::Rotator

Inherits:
Thumbnail
  • Object
show all
Defined in:
lib/paperclip/rotator.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, options = {}, attachment = nil) ⇒ Rotator

Returns a new instance of Rotator.



3
4
5
6
# File 'lib/paperclip/rotator.rb', line 3

def initialize(file, options = {}, attachment = nil)
  options[:auto_orient] = true
  super
end

Instance Method Details

#rotate_commandObject



16
17
18
19
20
21
# File 'lib/paperclip/rotator.rb', line 16

def rotate_command
  target = @attachment.instance
  if target.rotate.present?
    " -rotate #{target.rotate}"
  end
end

#transformation_commandObject



8
9
10
11
12
13
14
# File 'lib/paperclip/rotator.rb', line 8

def transformation_command
  if rotate_command
    "#{rotate_command} -strip #{super.join(' ')}"
  else
    super
  end
end