Class: Attachs::Processors::Thumbnail

Inherits:
Base
  • Object
show all
Defined in:
lib/attachs/processors/thumbnail.rb

Instance Method Summary collapse

Constructor Details

#initialize(attachment, source) ⇒ Thumbnail

Returns a new instance of Thumbnail.



5
6
7
8
# File 'lib/attachs/processors/thumbnail.rb', line 5

def initialize(attachment, source)
  super
  @width, @height = dimensions(source)
end

Instance Method Details

#process(style, destination) ⇒ Object



10
11
12
13
# File 'lib/attachs/processors/thumbnail.rb', line 10

def process(style, destination)
  new_width, new_height, strategy, options = geometry(style)
  resize source, width, height, new_width, new_height, strategy, options, destination
end