Class: Imagecache::Conversions::Resize

Inherits:
Object
  • Object
show all
Defined in:
lib/imagecache/conversions/resize.rb

Instance Method Summary collapse

Instance Method Details

#process(file, _metadata, conversion) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/imagecache/conversions/resize.rb', line 9

def process(file, , conversion)
  width = conversion.width
  height = conversion.height
  command = "convert #{file.path} -resize #{width}x#{height} #{file.path}"
  `#{command}`
  data = File.open(file.path).read
  File.unlink(file.path)
  data
end