我想从S3容器中读取照片的几何图形。回形针可以从S3存储桶读取照片几何图形吗?
当它在我的地方,这个工程:
def photo_geometry(style = :original)
@geometry ||= {}
@geometry[style] ||= Paperclip::Geometry.from_file photo.path(style)
end
但它似乎没有当我切换我的模型到S3 ..任何建议方面的工作?
更大的故事,是我正在尝试编写一些代码,它允许我从S3中检索照片,允许用户裁剪它们,然后将它们重新上传回到仍然由回形针指定的S3。
编辑:
这是返回的错误:
Paperclip::NotIdentifiedByImageMagickError: photos/199/orig/greatReads.png is not recognized by the 'identify' command.
from /Users/daniellevine/Sites/hq_channel/vendor/gems/thoughtbot-paperclip-2.3.1/lib/paperclip/geometry.rb:24:in `from_file'
from /Users/daniellevine/Sites/hq_channel/app/models/photo.rb:68:in `photo_geometry'
from (irb):1
#to_file在回形针3.0已被删除。 1。在该版本和更高版本中,使用'Paperclip :: Geometry.from_file(Paperclip.io_adapters.for(photo.styles [style]))' – 2014-09-23 18:42:04
@IsaacBetesh这不适用于我。我得到以下错误:'Paperclip :: AbstractAdapter#路径委托给@ tempfile.path,但@tempfile为零:Paperclip :: NilAdapter'。仅供参考,我使用s3和雾宝石。 – npouillard 2014-11-18 14:19:06
我直接使用S3(即aws-sdk gem),所以我不能说任何关于雾的明确信息,但是你的堆栈跟踪可能会包含一些线索。 – 2014-11-18 21:14:37