问题
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 format
inventaire/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?
回答1:
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
回答2:
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
回答3:
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.
回答4:
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
回答5:
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
来源:https://stackoverflow.com/questions/22715738/imagemagick-error