66
votes

I'm trying to convert an image with imagemagick, but I'm getting this error:

convert: no decode delegate for this image format `//i.imgur.com/nTheJ.jpg' @ error/constitute.c/ReadImage/532.

I'm doing this:

convert http://i.imgur.com/nTheJ.jpg -resize 600×600 filarkiv/billeder/produkter/s236-085145.jpg

I have the following delegates:

DELEGATES freetype jpeg jng mpeg png x11 xml zlib

Anyone knows what the problem is?

10
Well, you have the JPEG delegate and it says there is a problem. Which poses the question, what is the matter with the source file? Or, the JPEG installation.Orbling
Could you clarify what OS you're using, and which version of ImageMagick?florisla

10 Answers

15
votes

substitude the × in -resize 600×600 with a capital X and it should work.

-resize 600X600
75
votes

I had this error when rendering an image using DragonFly in Rails. This happened after I upgraded to Lion (ImageMagick was installed using Brew).

I reinstalled ImageMagick, jpeg, libtiff and jasper (reinstalling ImageMagick wasn't enough by itself).

brew uninstall imagemagick jpeg libtiff jasper
brew install imagemagick

Prior to that, running

identify -list format

and jpeg wasn't in the list. After reinstalling the above packages jpeg appeared in the list.

26
votes

for me:

 brew reinstall imagemagick --with-libtiff

saved the day when dealing with a similar problem, but for tiff files.

UPDATE: one year later and this remains the only way I can get tiff working properly in convert on MacOS X.

3
votes

I faced the same problem recently. After Googling for couple of hours, I found out that reason was a CONFLICT between php extentions Gmagick & Imagick. Commenting gmagick.so in php.ini fixed the problem. Hope this will save someone time :)

3
votes

redhat4.8, If you install from source, may be can try:

yum remove libjpeg

wget http://www.imagemagick.org/download/delegates/jpegsrc.v9a.tar.gz

sudo tar xvf jpegsrc.v9a.tar.gz -C /usr/local/src/

cd /usr/local/src/jpeg-9a

./configure --enable-shared

make

sudo make install

than turn in ImageMagick

cd ImageMagick-6.9.6-4

./configure

sudo make install

sudo ldconfig /usr/local/lib

3
votes

on Ubuntu 16, I had to install the following first (this was not a dev machine but a server):

sudo apt-get install autoconf automake autotools-dev libtool pkg-config 

then to enable the PNG and JPG delegates :

sudo apt-get install libpng12 libpng12-dev libjpeg libjpeg-dev

followed by

./configure

(Which should now show that the delegates are enabled)

and then rebuild (make clean && make then sudo make install)

2
votes

In my case, the solution was a matter of ending the command with *.{jpg,png} rather than *.

I believe the * was picking up / trying to convert hidden files.

2
votes

from Phillip Ingram somewhere on the interwebs:

in gentoo use

sudo EXTRA_ECONF="--with-png --with-jpeg" emerge imagemagick

This is slightly different than Jonathan Horseman's answer since it wasn't an error but rather a need to specify more during the installation.

But the identify command was very useful.

Hope this helps someone (and perhaps me in the future ;).

0
votes

I have encountered a similar problem with TIFF files on ImageMagick v7.0.4-5 on Windows 7.

If this question concerns a Windows OS, then the cause is that Windows can't find the Jpeg (in my case, TIFF) file library (DLL).

Cause

I had installed ImageMagick without adding it to the Windows $PATH.

Error message

This resulted in error

identify: unable to load module 'C:\Program Files\ImageMagick-7.0.4-Q16\modules\coders\IM_MOD_RL_TIFF_.dll':
The specified module could not be found.
 @ error/module.c/OpenModule/1279.
identify: no decode delegate for this image format `TIFF'
 @ error/constitute.c/ReadImage/509.

Solution

  • Re-install ImageMagick and do add it to the $PATH, so that it can find libtiff. Restart your command shell as well.
  • First cd into ImageMagick's install folder before executing it.
0
votes

i had the problem and i forgot put to obj downloaded photo against i put path.

file_get_contents($pathToPhoto)

maybe someone help :[