22

When trying to run ImageMagick via node-imagemagick on my Grunt task, i get this error from ImageMagick:

Warning: Command failed: identify: unable to load module /usr/local/Cellar/imagemagick/6.8.8-9/lib/ImageMagick//modules-Q16/coders/jpeg.la': file not found @ error/module.c/OpenModule/1275. identify: no decode delegate for this image formatinventaire/videos/OFF_Arrestation joueur_14_petit.jpg' @ error/constitute.c/ReadImage/501. Use --force to continue.

Why is ImageMagick trying to load JPG coder at /usr/local/Cellar/imagemagick/6.8.8-9/lib/ImageMagick//modules-Q16/coders/jpeg.la? Why the double slash after ImageMagick// ?

This grunt script run perfectly on OSX 10.8 and now fail on 10.9.2. Anyone know a way to fix it?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Dominic Mercier
  • 808
  • 2
  • 9
  • 17
  • Hey Dominic, did @emcconville's solution work for you? I am getting the same error with Imagemagick and paperclip. – rohitmishra Apr 09 '14 at 07:59

5 Answers5

23

I came across this issue too when upgrading from Mt.Lion to Mavericks. I found an issue in homebrew's github repo. The fix that worked for me was:

$ brew uninstall imagemagick
$ brew install imagemagick --build-from-source
9monkeys
  • 1,754
  • 1
  • 14
  • 13
17

OSX Mavericks seems break the link of jpeg lib. All you need to do is relink the jpeg, then reinstall imagemagick.

brew unlink jpeg
brew link jpeg

Then reinstall imagemagick from source

brew uninstall imagemagick
brew install imagemagick --build-from-source

Now you can check if jpeg is in the delegate

identify -list configure | grep DELEGATES

It should have jpeg now

DELEGATES bzlib mpeg freetype jng jpeg lcms lzma png tiff xml zlib

sbs
  • 4,102
  • 5
  • 40
  • 54
  • 1
    In my case, just `brew unlink jpeg`/`brew link jpeg` made the trick. – viphe Nov 19 '14 at 18:55
  • In my case, `brew unlink jpeg`/`brew link jpeg` alone did NOT do the trick, but adding `brew uninstall imagemagick`/`brew install imagemagick --build-from-source` (which took about 6 minutes) did indeed do the trick! – Quuxplusone Oct 11 '18 at 17:31
6

This is what finally worked for me after a bunch of installs and uninstalls. I removed and reinstalled imagemagick with these options

brew install imagemagick --with-fontconfig --with-ghostscript --with-libtiff --with-webp

I am only using jpeg and png for now, and am not sure how these options help, but worth a try.

rohitmishra
  • 8,739
  • 7
  • 33
  • 34
  • 1
    This also works without the flag `--with-ghostscript` – cogell Jun 11 '14 at 21:47
  • 1
    I had to remove `graphicsmagick` to be able to install `imagemagick` properly. – chovy Jul 14 '14 at 00:41
  • I had the same problem. Following [this](https://github.com/Homebrew/homebrew/issues/29708), and running `brew unlink libpng && brew link --overwrite libpng` fixed it for me. The **overwrite** was what made it work. – danomatika Apr 14 '15 at 22:40
  • thank you so much... i tried so many things. this finally worked for me – Christophe May 18 '15 at 11:53
6

This worked for me:

brew uninstall imagemagick@6 
brew install imagemagick@6 
PKG_CONFIG_PATH=/usr/local/opt/imagemagick@6/lib/pkgconfig gem install rmagick
Nakilon
  • 34,866
  • 14
  • 107
  • 142
3

ImageMagick's module dependencies are out of date by the systems upgrade. You'll need to re-install homebrew packages. See this articles "Upgrading homebrew packages on OSX Mavericks", or "Install ImageMagicK on OSX Lion."

Why is ImageMagick trying to load JPG coder at /usr/local/Cellar/imagemagick/6.8.8-9/lib/ImageMagick//modules-Q16/coders/jpeg.la

ImageMagick is expecting a static library for JPEG. The module is simply not there, or unreadable.

Why the double slash after ImageMagick// ?

This is common with homebrew. It's safe, and will resolve to ImageMagick/.

... know a way to fix it?

Run the followin in Terminal.app

brew uninstall imagemagick
brew update
brew cleanup
brew doctor
brew install imagemagick
emcconville
  • 23,800
  • 4
  • 50
  • 66
  • Did all that, still get `convert: unable to load module `/usr/local/Cellar/imagemagick/6.8.9-1/lib/ImageMagick//modules-Q16/coders/png.la': file not found @ error/module.c/OpenModule/1282.` – chovy Jul 14 '14 at 00:02