I’m using RMagick and want my images to be resized to a fixed width of 100px, and scale the height proportionally. For example, if a user were to upload a 300x900px, I would like it to be scaled to 100x300px.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Just put this in your uploader file:
Documentation and example here: http://www.imagemagick.org/RMagick/doc/image3.html#resize_to_fit
Keep in mind,
resize_to_fitwill scale up images if they are smaller than 100px. If you don’t want it to do that, then replace that withresize_to_limit.