我有我的应用程序一个莫名其妙类似的问题。 虽然我想我知道了,当使用版本时, 将每个'进程'设置为一个版本是有帮助的...... 否则我已经注意到有些方法'覆盖其他'... 奇怪。
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
if Rails.env == "production"
storage :aws
else
storage :file
end
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
#this is the 'first' process, 'while you upload', the one that seems to be an issue
process resize_to_fill: [228, 250]
version :industry do
process resize_to_fit: [228, 250]
end
version :portrait do
process resize_to_fill: [360, 200]
end
version :modal do
process resize_to_fill: [330, 300]
end
end
这将继而成为::
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
if Rails.env == "production"
storage :aws
else
storage :file
end
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
#i put everything as a version and it sorts the problem out..
version :base do
process resize_to_fill: [228, 250]
end
version :industry do
process resize_to_fit: [228, 250]
end
version :portrait do
process resize_to_fill: [360, 200]
end
version :modal do
process resize_to_fill: [330, 300]
end
end
我希望这是 '真',将是有益的其他用户
马林
我面临着同样的问题。你修好了吗?如果你能分享这个解决方案,将会非常感激。谢谢 – svs 2012-02-17 12:34:51
你好,同样在这里。我的意思是如果我只指定1个版本,它的工作原理是正确的,但是当多个版本出现时,它只会产生一个版本。这可能是一些版本bug可能? o.O – p1100i 2012-02-26 13:18:11