Ruby EXIFR 找不到文件
我正在尝试使用 EXIF 阅读器,但仍然收到错误“Errno::ENOENT: No such file or directory”,
我已经检查过,该文件肯定存在于我将其定向到的位置:(
<%= EXIFR::JPEG.new('/system/datas/5/original/IMG_0011.JPG').date_time %>
这是回形针的位置)在上传时放置文件)
有关为什么我继续收到此错误的任何想法。我认为问题可能不是找到文件,但该错误掩盖了真正的问题。
我需要从图片文件中检索 EXIF 数据。欢迎任何其他想法。我正在使用回形针上传文件。
谢谢!
I am trying to use the EXIF reader and I continue to get the error "Errno::ENOENT: No such file or directory"
I have checked and the file most certainly exists in the location I am directing it to:
<%= EXIFR::JPEG.new('/system/datas/5/original/IMG_0011.JPG').date_time %>
(This is where paperclip puts the files upon uploading)
Any ideas on why I continue to receive this error. I think the problem may not be finding the file but that error is masking the real issue.
I need to retrieve the EXIF data from picture files. Any other ideas are welcome. I am using paperclip to upload files.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您提供给 EXIFR 的路径是 URL,而不是系统上的路径。尝试一下:
该文件存储在 Rails 应用程序的
public
目录中,因此请执行以下操作:但是回形针还提供了访问路径的方法,那就是通过
path
代码>方法:The path you provided to EXIFR is a URL, not a path on the system. Try it:
The file is stored in the
public
directory of your rails app, so do something like:But paperclip also provides a method to access the path, and that is through the
path
method:这对你有用吗
Does this work for you