Method: UploadColumn::Manipulators::RMagick#resize!

Defined in:
lib/upload_column/manipulators/rmagick.rb

#resize!(geometry) ⇒ Object

Resize the image so that it will not exceed the dimensions passed via geometry, geometry should be a string, formatted like ‘200x100’ where the first number is the height and the second is the width



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/upload_column/manipulators/rmagick.rb', line 36

def resize!( geometry )
  manipulate! do |img|
    img.change_geometry( geometry ) do |c, r, i|
      if i.rows > c || i.columns > r
        i.resize(c,r)
      else
        i
      end
    end
  end
end