ImageMagick: decoding delegate for this image format `` @ error / make up .c / ReadImage / 504

Problem: ImageMagick convert cannot crop the image. Doesn't it seem to recognize the type of image?

What I tried:

I searched on the Internet and I saw several similar problems, but not mine. I tried to solve them, including

  • Uninstall and reinstall ImageMagick through Brew.
  • define the -list format (JPEG, GIF, PNG, TIFF, etc. were all there, and all had rw rights)
  • convert -version (png is one of the built-in delegates)
  • convert pic1.png pic1-jpg.jpg (this worked fine)
  • convert pic1-jpg.jpg pic1-jpg.jpg (this worked fine)
  • convert pic1-jpg.jpg 805X972 + 34 + 94 pic1-jpg-crop.jpg (this led to the same error as for png, as shown below)

I work on Mac OSX El Capitan and everything else in the terminal is working fine. ImageMagick has already been installed.

When I run:

$ convert /Users/Innovate/Desktop/crop/2015-04-26-GinaDate13_487.png 805X972+34+94 /Users/Innovate/Desktop/crop/2015-04-26-GinaDate13_487-cropped.png 

I got:

convert: cannot open image '805X972 + 34 + 94': there is no such file or directory @ error / blob.c / OpenBlob / 2702.

convert: there is no decoding delegate for this image format '' @ error / constitute.c / ReadImage / 504.

no decoding delegate for this image format '' @ error / constitute.c / ReadImage / 504

In other posts on this subject, people get

convert delegate without decoding for this PNG image format

Or similar (except for their image type or file name and image type)

However, mine says nothing about the type of image file ...

I did not try to uninstall ImageMagick and then install it manually from the sources, because I am not very sure about this ... (this solution was shown: https://stackoverflow.com/a/167379/ )

Does anyone know what might happen?

Also, can someone help me interpret the @ error / constitute.c / ReadImage / 504 part? I am looking at the code for construct.c, but I'm not sure if I can get useful information from it to solve my problem (I know a little C)

Thanks!

+16
source share
7 answers
 brew remove imagemagick //to delete current version brew install imagemagick --build-from-source 

fixed it for me on mac

+13
source

Ok, playing around, I figured out a solution, and I'm posting it here to other people who may run into this problem:

Apparently, this is not / no more / not for me a way to crop the image using ImageMagick convert. Although this usage is shown here , it did not work for me using El Capitan (maybe this is the OS?).

Instead of using

convert img.png 805X972 + 34 + 94 img-crop.png

The correct command that works is:

convert image.png -crop 805X972 + 34 + 94 image-crop.png

That is, the command:

convert image.ext -crop heightXwidth + positionX + positionY * imagecropped.ext

More details can be found here . From the description on this ImageMagick page, I was confused by the example when they converted rose: -crop, but you can just use it as I mentioned above, and it works great.

+2
source

Throwing at my two cents, as I also struggled with this problem over the past few days. I had no problems running ImageMagick commands on my local machine, but I received an error message as mentioned in the OP when I ran the command from a Tomcat server running on Azure Cloud.

I could determine the cause by running the following command:

 convert -list format 

On my local machine, it will return a fairly long list of all supported formats, while on Kudu (Azure CLI tool) it will return an empty result. This means that ImageMagick did not find the path to its DLL files needed for processing.

In my case, the problem was simply caused by a lack of configuration on Azure:

  • Missing ImageMagick root in system variable% PATH%
  • Missing environment variable "MAGICK_HOME" (installs in the root folder of your ImageMagick installation directory)
  • The absence of the environment variable "MAGICK_CODER_MODULE_PATH" (installed in the above + / modules / coders folder)

NOTE. For people who are also experiencing this issue on Azure, you can see this SO answer that explains how to add an environment variable using XDT Transform.

+2
source

I was getting the same error for missing some single quotes.

When combining images with convert -draw with quotation marks, the provided image must be enclosed in quotation marks.

Decoding defragmenter for this image format `` @ error / make up .c / ReadImage / 504

 convert myBackground.png -font Arial -pointsize 20 \ -draw "gravity west image Over 50,80,20,20 'myForeground.png'" \ # -----------------------------------------^ added missing single quotes -flatten ./finalImage.jpg 

When I added single quotes around myForeground , the problem disappeared. What a lousy mistake!

+1
source

Alternative Imagemagick Command:

 convert pic1-jpg.jpg[805x972+34+94] pic1-jpg-crop.jpg 

or as stated earlier

 convert pic1-jpg.jpg -crop 805x972+34+94 +repage pic1-jpg-crop.jpg 

see Inline Image Crop at https://www.imagemagick.org/script/command-line-processing.php

Generally, I prefer to use x (lowercase) rather than X (uppercase) between width and height, for readability. But it either works.

0
source

I also had to deal with this problem today in a conversion operation that applied a different color space profile.

The imagick convert command seems to be sensitive to the extension of the profile file name. In my case, it was a temporary file without a suffix, which caused the same error message from the question header.

 convert infile.jpg -profile /tmp/profile-without-suffix outfile.jpg 

Adding the correct suffix to the profile file name fixes the problem:

(subject to ICC format)

 convert infile.jpg -profile /tmp/profile-without-suffix.icc outfile.jpg 
0
source

For me (on Macos Mojave, using Imagick with CraftCMS) I had to reinstall Imagick with pecl uninstall imagick and pecl install imagick (and then restart Apache with sudo apachectl -k restart ). I must have run brew upgrade and received a newer version of ImageMagick, resulting in Imagick NoDecodeDelegateForThisImageFormat 'JPEG' @error/constitute.c/ReadImage/556 similar error NoDecodeDelegateForThisImageFormat 'JPEG' @error/constitute.c/ReadImage/556 .

0
source

All Articles