简体   繁体   English

Attachment_fu错误

[英]Attachment_fu error

I am getting an error while trying to upload images on an Ubuntu machine that's running Rails 2.3.4, Ruby 1.8.6 using attachment_fu with image science. 尝试在使用Rails 2.3.4和Ruby 1.8.6的Ubuntu计算机上使用image_science的附件_fu上传图像时遇到错误。

FreeImage exception for type ???: IPTC: Invalid key 'Tag 0x025C' 类型的FreeImage异常:IPTC:无效的密钥'Tag 0x025C'

The error seems to point to this line in the image_science_processor in the attachment_fu plugin: 错误似乎指向attachment_fu插件中image_science_processor中的这一行:

def with_image(file, &block)
 ::ImageScience.with_image file, &block
end

My initial thoughts are that it has something to do with meta tags and the images and maybe free image. 我最初的想法是,它与meta标签,图片以及免费图片有关。 I don't actually see this error on my dev machine - Mac Snow Leopard, Rails 2.3.5, Ruby 1.8.7. 在我的开发机-Mac Snow Leopard,Rails 2.3.5,Ruby 1.8.7上,我实际上没有看到此错误。 Before I start messing versions on the production boxes, has anyone else encountered this issue and have an idea to fix it? 在开始在生产包装盒上弄乱版本之前,是否有其他人遇到此问题并有解决此问题的想法?

THANKS!!!! 谢谢!!!!

I'm running into exactly the same error -- I too believe it has something to do with the images that are being uploaded, however I can't really get any good information on what would cause this or what to do about it. 我遇到了完全相同的错误-我也相信这与正在上传的图像有关,但是我无法真正获得有关导致此问题或如何处理的任何良好信息。 Have you had any luck on figuring this out? 你有运气解决这个问题吗?

UPDATE: 更新:

I was able to fix this issue by assigning the content_type after the attachment_fu model is created 创建附件_fu模型后,我可以通过分配content_type来解决此问题

example: 例:

@photo_upload = HsPhotoUpload.new(params[:hs_photo_upload])    
@photo_upload.content_type = MIME::Types.type_for(params[:hs_photo_upload][:uploaded_data]).first.to_s
@photo_upload.save!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM