Class: Imagecache::Conversions::Round

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

Instance Method Summary collapse

Instance Method Details

#process(file, metadata, conversion) ⇒ Object



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

def process(file, , conversion)
  shortest = [.width, .height].min
  radius = (conversion.radius / 100.to_f) * shortest
  command = command(file.path, radius)
  `#{command}`
  data = File.open("#{file.path}.png").read
  File.unlink("#{file.path}.png")
  File.unlink(file.path)
  data
end