lib/carrierwave/processing/mini_magick.rb
##
# 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
# [combine_options (Hash)] additional ImageMagick options to apply before resizing
#
# === Yields
#
# [MiniMagick::Image] additional manipulations to perform
#
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
[combine_options (Hash)] additional ImageMagick options to apply before resizing

Yields

[MiniMagick::Image] additional manipulations to perform
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 [ combine_options ( Hash ) ] additional ImageMagick options to apply before resizing Yields [ MiniMagick :: Image ] additional manipulations to perform
def resize_to_fit(width, height, combine_options: {}, &block)
      width, height = resolve_dimensions(width, height)
      minimagick!(block) do |builder|
        builder.resize_to_fit(width, height)
          .apply(combine_options)
      end
    end
def resize_to_fit ( width , height , combine_options : { } , & block ) width , height = resolve_dimensions ( width , height ) minimagick! ( block ) do | builder | builder . resize_to_fit ( width , height ) . apply ( combine_options ) end end
Resize the image to fit within the specified dimensions while retaining
the original aspect ratio.
Resize the image to fit within the specified dimensions while retaining the original aspect ratio .
width
height
combine_options
block