lib/carrierwave/processing/rmagick.rb in carrierwave-0.4.5 vs lib/carrierwave/processing/rmagick.rb in carrierwave-0.4.6
- old
+ new
@@ -85,12 +85,12 @@
def resize_to_fit(width, height)
process :resize_to_fit => [width, height]
end
- def resize_to_fill(width, height)
- process :resize_to_fill => [width, height]
+ def resize_to_fill(width, height, gravity=::Magick::CenterGravity)
+ process :resize_to_fill => [width, height, gravity]
end
def resize_and_pad(width, height, background=:transparent, gravity=::Magick::CenterGravity)
process :resize_and_pad => [width, height, background, gravity]
end
@@ -183,12 +183,12 @@
#
# === Yields
#
# [Magick::Image] additional manipulations to perform
#
- def resize_to_fill(width, height)
+ def resize_to_fill(width, height, gravity=::Magick::CenterGravity)
manipulate! do |img|
- img.crop_resized!(width, height)
+ img.crop_resized!(width, height, gravity)
img = yield(img) if block_given?
img
end
end