module CarrierWave::MiniMagick
def resize_to_fill(width, height, gravity = 'Center', combine_options: {}, &block)
[MiniMagick::Image] additional manipulations to perform
=== Yields
[combine_options (Hash)] additional ImageMagick options to apply before resizing
[gravity (String)] the current gravity suggestion (default: 'Center'; options: 'NorthWest', 'North', 'NorthEast', 'West', 'Center', 'East', 'SouthWest', 'South', 'SouthEast')
[height (Integer)] the height to scale the image to
[width (Integer)] the width to scale the image to
=== Parameters
larger dimension.
the aspect ratio of the original image. If necessary, crop the image in the
Resize the image to fit within the specified dimensions while retaining
#
def resize_to_fill(width, height, gravity = 'Center', combine_options: {}, &block) width, height = resolve_dimensions(width, height) minimagick!(block) do |builder| builder.resize_to_fill(width, height, gravity: gravity) .apply(combine_options) end end