Method: ImageProcessing::MiniMagick.resample!
- Defined in:
- lib/image_processing/mini_magick.rb
.resample!(image, width, height) {|MiniMagick::Tool::Mogrify, MiniMagick::Tool::Convert| ... } ⇒ File, Tempfile
Resample the image to fit within the specified resolution while retaining the original image size.
The resulting image will always be the same pixel size as the source with an adjusted resolution dimensions.
170 171 172 173 174 175 176 177 |
# File 'lib/image_processing/mini_magick.rb', line 170 def resample!(image, width, height) with_minimagick(image) do |img| img. do |cmd| yield cmd if block_given? cmd.resample "#{width}x#{height}" end end end |