lib/carrierwave/processing/rmagick.rb
def resize_to_fit(width, height)
      width = dimension_from width
      height = dimension_from height
      manipulate! do |img|
        img.resize_to_fit!(width, height)
        img = yield(img) if block_given?
        img
      end
    end
##
# From the RMagick documentation: "Resize the image to fit within the
# specified dimensions while retaining the original aspect ratio. The
# image may be shorter or narrower than specified in the smaller dimension
# but will not be larger than the specified values."
#
# See even http://www.imagemagick.org/RMagick/doc/image3.html#resize_to_fit
#
# === Parameters
#
# [width (Integer)] the width to scale the image to
# [height (Integer)] the height to scale the image to
#
# === Yields
#
# [Magick::Image] additional manipulations to perform
#
From the RMagick documentation: "Resize the image to fit within the
specified dimensions while retaining the original aspect ratio. The
image may be shorter or narrower than specified in the smaller dimension
but will not be larger than the specified values."



Parameters

[width (Integer)] the width to scale the image to
[height (Integer)] the height to scale the image to

Yields

[Magick::Image] additional manipulations to perform
From the RMagick documentation : " Resize the image to fit within the specified dimensions while retaining the original aspect ratio . The image may be shorter or narrower than specified in the smaller dimension but will not be larger than the specified values . " Parameters [ width ( Integer ) ] the width to scale the image to [ height ( Integer ) ] the height to scale the image to Yields [ Magick :: Image ] additional manipulations to perform
def resize_to_fit(width, height)
      width = dimension_from width
      height = dimension_from height
      manipulate! do |img|
        img.resize_to_fit!(width, height)
        img = yield(img) if block_given?
        img
      end
    end
def resize_to_fit ( width , height ) width = dimension_from width height = dimension_from height manipulate! do | img | img . resize_to_fit! ( width , height ) img = yield ( img ) if block_given? img end end
From the RMagick documentation: "Resize the image to fit within the
specified dimensions while retaining the original aspect ratio.
From the RMagick documentation : " Resize the image to fit within the specified dimensions while retaining the original aspect ratio .
width
height