Class: Paperclip::Rotator

Inherits:
Thumbnail
  • Object
show all
Defined in:
lib/paperclip_processors/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_processors/rotator.rb', line 3

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

Instance Method Details

#rotate_commandObject



16
17
18
19
20
21
# File 'lib/paperclip_processors/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_processors/rotator.rb', line 8

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