我在使用Paperclip的Rails 3应用程序中有一个非常奇怪的错误。当用户上传图片时,有时会出现以下错误:
[paperclip] identify -format %wx%h '/tmp/stream20110911-3451-121byoe-0.jpg[0]'
[paperclip] convert '/tmp/stream20110911-3451-121byoe-0.jpg[0]' -resize "80x80>" '/tmp/stream20110911-3451-121byoe-020110911-3451-g7uh3x-0'
[paperclip] identify -format %wx%h '/tmp/stream20110911-3451-121byoe-0.jpg[0]'
[paperclip] convert '/tmp/stream20110911-3451-121byoe-0.jpg[0]' -resize "1000x625>" '/tmp/stream20110911-3451-121byoe-020110911-3451-206k0u-0'
[paperclip] An error was received while processing: #<Paperclip::PaperclipError: There was an error processing the thumbnail for stream20110911-3451-121byoe-0>
如果用户尝试再次上传相同的图像,通常可以正常工作(有时会再次出现错误)。
这种非确定性行为可能是什么原因?
我如何进一步调试以了解此错误的真正原因?
以下是一些相关代码:
class Asset < ActiveRecord::Base
has_attached_file :asset,
:styles => { :thumb => "80x80>",
:medium => "1000x625>" },
:path => ":rails_root/../my_project_uploads/:class/:id/:style.:extension",
:url => "/:class/:id/:style"
...
end
# config\initializers\paperclip.rb
Paperclip.options[:swallow_stderr] = false