新手问题 carrierwave 设置头像 version

yuchengzhixia · 2013年04月26日 · 最后由 huacnlee 回复于 2013年04月28日 · 2651 次阅读

用 mongoid+carrierwave 作用户头像上传处理,用 grid_fs 存储,需要以下头像版本: small: 50*50 normal: 80*80 big: 130*130 huge: 200*200 mobile: 130*130 For retina small@2x: 100*100 normal@2x: 160*160 big@2x: 260*260 huge@2x: 400*400 mobile@2x: 260*260

已经写了基本版本: version :small do process resize_to_fill: [50, 50] end

version :normal do process resize_to_fill: [80, 80] end

version :big do process resize_to_fill: [130, 130] end

version :huge do process resize_to_fill: [200, 200] end

version :mobile do process resize_to_fill: [130, 130] end For retina 的该怎么写?

version :retina_normal ...

#1 楼 @Rei 就是不想再写 5 个,能不能调用前面写过的

#2 楼 @yuchengzhixia 那你就每个大尺寸是小尺寸的两倍就好了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号