0
votes

I have a similar issue to this post: ImageMagick: No decode delegate for this image format `' @ error/constitute.c/ReadImage/504

Whenever I use imagemagick in my command line it appears to work, however inside of my development environment with Ruby on Rails, any imagemagick commands throw the error: No decode delegate for this image format `'

As mentioned in the linked question, most posts have a specific delegate missing but my imagemagick has: DELEGATES bzlib mpeg freetype jng jpeg lzma png tiff xml zlib

This error occurs when running Magick::Image.from_blob, to_blob, columns, or rows specifically inside my program.

I also have rMagick installed as a gem to handle these commands and this occurs in both Rails 2 and Rails 4.

Has anyone come across this situation and have any ideas why my ImageMagick is not identifying the type of image?

1
What was your command line command? Which delegate is it complaining about? I have seen this with the use of Ghostscript in PHP Imagick. PHP (or in your case Ruby) may not use the same environment PATH. The solution I have heard was to put the full path to the delegate library in your delegates.xml file. I have not personally dealt with this issue since I mostly just use the command line. Sorry I do not use Ruby or know much about it.fmw42
Can you give us an example of the command being run (both in the command line and what is being run from your rails program)? What have you checked to make sure that things are the same from your rails environment to your command line? eg have you tried running the command-line command using bundle exec ?Taryn East

1 Answers

0
votes

Okay so i finally figured it out. The solution was that when I install rMagick, I had not correctly set the path to point to the correct version of imagemagick. Eventually I ran the command for convert in the Rails environment on command line and got the full error with the title in the error instead of just No decode delegate for this image format `'.

I installed imagemagick using homebrew and when i installed the gem, the package config path was pointing to the wrong place.

I put "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/" in my bash_profile and restarted the shell. Then I uninstalled rmagick and ran bundle install again and it worked.

That PKG_CONFIG_PATH has many symbolic links in it to point the rmagick gem to correct place, allowing it to work correctly this time!