我hava uploader
class PimageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
storage :webdav if Rails.env.production?
storage :file if Rails.env.development?
version :preview do
process resize_to_limit: [640, 640]
end
version :post do
process resize_to_limit: [640, nil]
end
version :thumb do
process resize_to_limit: [150, nil]
end
end
帮助我,我需要使用扩展程序gif make only thumb version。
答案 0 :(得分:2)
尝试使用以下内容:
version :thumb, :if => :is_gif?
protected
def is_gif?(picture)
picture.extension.to_s.downcase == 'gif'
end