lib/image_science.rb
##
# Creates a proportional thumbnail of the image scaled so its longest
# edge is resized to +size+ and yields the new image.
Creates a proportional thumbnail of the image scaled so its longest
edge is resized to +size+ and yields the new image.
Creates a proportional thumbnail of the image scaled so its longest edge is resized to + size + and yields the new image .
def thumbnail(size) 
    w, h = width, height
    scale = size.to_f / (w > h ? w : h)
    self.resize((w * scale).round, (h * scale).round) do |image|
      yield image
    end
  end
def thumbnail ( size ) w , h = width , height scale = size . to_f / ( w > h ? w : h ) self . resize ( ( w * scale ) . round , ( h * scale ) . round ) do | image | yield image end end
Creates a proportional thumbnail of the image scaled so its longest
edge is resized to +size+ and yields the new image.
Creates a proportional thumbnail of the image scaled so its longest edge is resized to + size + and yields the new image .
# :yields: image
size