imagemagick error: no decode delegate for this image format

2,002 views
Skip to first unread message

Jeff Deville

unread,
Dec 12, 2011, 12:04:50 PM12/12/11
to PhillyRB
Hello all, I've got a weird one. 

I am getting this error :
Magick::ImageMagickError: no decode delegate for this image format `' @ error/blob.c/BlobToImage/349
from (irb):7:in `from_blob'
from (irb):7
from /Users/jeffdeville/.rvm/gems/ruby-1.9.2-p290@wg/gems/railties-3.1.1/lib/rails/commands/console.rb:45:in `start'
from /Users/jeffdeville/.rvm/gems/ruby-1.9.2-p290@wg/gems/railties-3.1.1/lib/rails/commands/console.rb:8:in `start'
from /Users/jeffdeville/.rvm/gems/ruby-1.9.2-p290@wg/gems/railties-3.1.1/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

which is from this line:  Magick::Image.from_blob(blob)

in this code:

However, this ONLY happens in my Rails environment. If I run this with just ruby 'filename', it works fine, which I assume means I don't have imagemagick installation issues that my google search turned up.  

The images are some variety of jpg.  Here's one.  

I am not having this problem w/ all jpgs.  Images from amazon are processed fine, for example.

Any ideas here?  The only thing I can think is that my Gemfile must be loading something that is causing problems

Thanks all.
-jeff

Jeff Deville

unread,
Dec 12, 2011, 12:22:47 PM12/12/11
to PhillyRB
Well, seem to have fixed the issue by not loading the blob separately.  So rather than:
blob = open(URL).read
Image::Magick.from_blob

I changed it to:
Image::Magick.read(URL)

I assume the url's extension provided the context it needed.  Still no idea why it would work from the commandline, but not rails, but umm…  whatever. :-)

Jeff
@jeffdeville
My Startups:
  wishgenies.com | @wishgenies
  launch.mixmeupapp.com | @mixmeupapp

Reply all
Reply to author
Forward
0 new messages