【问题标题】:rails attachment_fu public_filename problemrails attachment_fu public_filename 问题
【发布时间】:2009-10-06 23:50:49
【问题描述】:

attachment_fu 生成错误的 public_filename。

>> pic.thumbnails => ProductPicture id: 12331, product_id: nil, parent_id: 12330, content_type: "image/png", filename: "b_9788994035109_mid.png", thumbnail: "mid", size: 16562, width: 205, height: 205, created_at :“2009-10-05 02:43:50”,更新时间:“2009-10-05 02:43:50”, ProductPicture id: 12332, product_id: nil, parent_id: 12330, content_type: "image/png", filename: "b_9788994035109_thumb.png", thumbnail: "thumb", size: 2300, width: 52, height: 52, created_at: " 2009-10-05 02:43:51”,更新时间:“2009-10-05 02:43:51” >> 图片 ProductPicture id: 12330, product_id: 23236, parent_id: nil, content_type: "image/gif", 文件名: "b_9788994035109.gif", 缩略图: nil, size: 73990, width: 400, height: 400, created_at: "2009- 10-05 02:43:50”,更新时间:“2009-10-05 02:43:50” >> pic.thumbnails => ProductPicture id: 12331, product_id: nil, parent_id: 12330, content_type: "image/png", filename: "b_9788994035109_mid.png", thumbnail: "mid", size: 16562, width: 205, height: 205, created_at : "2009-10-05 02:43:50", updated_at: "2009-10-05 02:43:50", ProductPicture id: 12332, product_id: nil, parent_id: 12330, content_type: "image/png",文件名:“b_9788994035109_thumb.png”,缩略图:“thumb”,大小:2300,宽度:52,高度:52,created_at:“2009-10-05 02:43:51”,updated_at:“2009-10-05 02 :43:51" >> pic.public_filename => "/product_pictures/0001/2330/b_9788994035109.gif" >> pic.public_filename(:mid) => "/product_pictures/0001/2330/b_9788994035109_mid.gif"

当实际类型为 '.png'(gif 是父类型)时,它会生成“.gif”而不是“.png”

这适用于我的开发机器,但不适用于我的生产机器。

有什么想法吗?

谢谢。

山姆

【问题讨论】:

    标签: ruby-on-rails attachment-fu


    【解决方案1】:

    我想通了。

    我没有在 attachment_fu 中指定 :processor 并且它使用任何已安装的处理器。 我的开发机器有 ImageScience 和 RMagick,而我的生产机器只有 RMagick。 ImageScience 将 gif 调整为 png,因为它不能很好地处理 gif。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-11-25
      • 2011-04-27
      • 1970-01-01
      • 2011-01-23
      • 1970-01-01
      • 1970-01-01
      • 2011-02-25
      相关资源
      最近更新 更多