carrierwave
https://github.com/carrierwaveuploader/carrierwave
Ruby
Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
CarrierWave::RMagick#resize_to_fill
From the RMagick documentation: "Resize the image to fit within the specified dimensions while retaining the aspect ratio of the original image. If necessary, crop the image in the larger dimension." See even http://www.imagemagick.org/RMagick/doc/image3.html#resize_to_fill === 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
Edit
git clone [email protected]:carrierwaveuploader/carrierwave.git
cd carrierwave
open lib/carrierwave/processing/rmagick.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-CarrierWave--RMagick-resize_to_fill-for-pr
# Commit to gitgit add lib/carrierwave/processing/rmagick.rbgit commit -m "better docs for CarrierWave::RMagick#resize_to_fill"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-CarrierWave--RMagick-resize_to_fill-for-pr
hub pull-request
# Celebrate!