【发布时间】:2013-02-18 11:04:26
【问题描述】:
我有以下代码,它调整大小和图像,然后添加一些十六进制背景。在本地主机上这有效,但在 heroku 上我收到以下错误
version :big do
process :offer_resize_and_pad
end
def offer_resize_and_pad
img = resize_and_pad(600, nil, model.hex, 'Center')
img
end
"Photo Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: Command (\"mogrify -thumbnail \"600x>\" -background \"#fff\" -gravity \"Center\" -extent \"600x\" /tmp/mini_magick20130217-2-1hts61y.jpg\") failed: {:status_code=>1, :output=>\"mogrify: Empty JPEG image (DNL not supported)/tmp/mini_magick20130217-2-1hts61y.jpg'@jpeg.c/EmitMessage/232.\n\"
【问题讨论】:
-
这可能是因为您对 Heroku 上的文件系统的访问权限与您在本地计算机(即 /tmp 目录)上的访问权限不同。
-
你说得有道理。但是,我该如何解决这个问题? .还有来自其他上传者的其他图片,这很有效。
-
当我将我的 Gemfile 从 mini_magick (4.0.1) 更新到 (4.3.6) 时出现类似错误,请参阅 github.com/minimagick/minimagick/issues/338
标签: ruby-on-rails ruby-on-rails-3 heroku minimagick