0
我上傳了使用CarrierwaveUploader的圖片,我想resize_to_limit
,所以我在Carrierwave中啓用了RMagick。如何調整大小以限制已保存的img?
class Word < ActiveRecord::Base
...
mount_uploader :image, ImageUploader
end
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
storage :file
def store_dir
...
end
def filename
...
end
version :thumb do
process :resize_to_limit => [400, 400]
end
end
新上傳的圖片是resized-to-limit
,但我不知道如何對已經保存的圖像應用resize-to-limit
。