载波并调整为特定宽度 [英] CarrierWave and resize to a specific width

查看:43
本文介绍了载波并调整为特定宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Rails 3.0中使用CarrierWave,您将如何使代码
将宽度大于500像素的图像大小调整为500像素,并适当调整高度-保持宽度与高度的初始比例相同。

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.

推荐答案

您可以使用:

process :resize_to_limit => [500, nil]

这篇关于载波并调整为特定宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆