2

Rails3 on passenger. I have imagemagick installed and working correctly however I receive the following error when trying to add an image via paperclip. This works fine on in development, but not in production on passenger.

[paperclip] An error was received while processing: #<Paperclip::PaperclipError: There was an error processing the thumbnail for stream,11629,0>
    [paperclip] /usr/bin/identify '-format' '%wx%h' '/tmp/stream,11629,0.jpg[0]'
    [paperclip] /usr/bin/convert '/tmp/stream,11629,0.jpg[0]' '-resize' '100x100>' '/tmp/stream,11629,0,11629,1'

I created a paperclip.rb file in config/initializers and added

Paperclip.options[:swallow_stderr] = false
Paperclip.options[:command_path] = "/usr/bin/"

but it hasn't fixed it for me. Any ideas?

raphael_turtle
  • 7,154
  • 10
  • 55
  • 89

2 Answers2

0

Check to see if rmagick is installed...

Run these commands

irb -rubygems -r RMagick

And then once inside of irb:

puts Magick::Long_version

You should get output like:

This is RMagick 2.13.1 ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter Built with ImageMagick 6.5.9-3 2010-02-19 Q16 http://www.imagemagick.org Built for ruby 1.8.7 Web page: http://rmagick.rubyforge.org Email: rmagick@rubyforge.org => nil

If you don't, then I think rmagick is not installed

Jesse Wolgamott
  • 40,197
  • 4
  • 83
  • 109
  • 1
    Unfortunately, this won't solve the issue. Paperclip doesn't actually use RMagick. Paperclip shells out to ImageMagick. To check ImageMagick is correctly installed: `identify -version` or `convert -version`. – myabc Oct 12 '10 at 13:35
  • RMagick is installed.This is RMagick 2.13.1 ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter Built with ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org Built for ruby 1.8.7 Web page: http://rmagick.rubyforge.org Email: rmagick@rubyforge.org => nil – raphael_turtle Oct 12 '10 at 13:35
  • convert -version Version: ImageMagick 6.5.7-8 2009-11-26 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC Features: OpenMP – raphael_turtle Oct 12 '10 at 13:37
  • @myabc - "RMagick is an interface between the Ruby programming language and ImageMagick/ GraphicsMagick." – Jesse Wolgamott Oct 12 '10 at 21:44
  • It is indeed. RMagick is used by many other libraries, but not by Paperclip. Paperclip prefers instead to shell out to ImageMagick CLI tools. – myabc Oct 13 '10 at 10:05
0

I have got a similar error ("processing the thumbnail for stream") if I try to create rounded corners with Paper clip ..

Command :: convert '/tmp/stream20120109-15817-1lju7p6-0.jpg[0]' -resize "918x" 
    [.. complicated options here..] 
    '/tmp/stream20120109-15817-1lju7p6-020120109-15817-17dl83e-0.png'
[paperclip] An error was received while processing: #<Paperclip::PaperclipError: 
There was an error processing the thumbnail for stream20120109-15817-1lju7p6-0>

How does your options for has_attached_file look like? Maybe a problem with ImageMagick parameters. In my case I wrote a plus sign instead of a minus - you had to use -alpha off instead of +alpha off - then error vanishes. Sometimes a single sign (- instead of + or vice versa) makes the difference.

0x4a6f4672
  • 27,297
  • 17
  • 103
  • 140