Using CarrierWave in Rails 3.0 how would you go about making the code resize images that have a width larger than 500 pixels to be 500 pixels wide and adjust the height appropriately - keeping the same initial ratio of width to height.
You Can use:
process :resize_to_limit => [500, nil]
process :resize_to_limit => [500, 0]
This will process the image to be no wider than 500px while retaining the proper aspect ratio and allowing any height.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With