Imagick Not Loading Images, with 'Nodecodedelegateforthisimageformat' Error Message

Imagick not loading images, with 'NoDecodeDelegateForThisImageFormat' error message

I think your version of the underlying Image Magick library is running without support for the image format that you're trying to open. You should be able to test this by running:

identify -list format

And seeing if JPEG 2000 or JP2 is listed.

EDIT

The OP updated with the list of image formats listed by Image Magick and it seemed a complete list of formats. However running Imagick::queryFormats() in PHP shows that no image formats are supported.

This apparently is a common problem when you are using a version of the Image Magick DLL that is not the correct version for your installed PHP version. Imagick will claim to be loaded without errors, but there will be no image formats available for either loading or saving images.

Php imagemagick NoDecodeDelegateForThisImageFormat readimagetoblob SVG error

The problem lied in having a faulty installation of imagick. once i ran this on a live site, it worked.

PHP-Imagick on OSX, ImagickException: NoDecodeDelegateForThisImageFormat `/my-path/file.jpg' @ error/constitute.c/ReadImage/550

Solution

chmod 755 /opt

Insight and Thoughts

At last. I managed to solve the problem.

As there were no answers and suggestions on SO; I'm not suprised that something not expected was causing it!..

@sathia suggested to define an environment variable to call ImageMagick binaries. However in my case, I need to use phpImagick extension and access ImageMagick through its API, so this suggestion didn't make sense.

But I wanted to give it a try and call ImageMagick's convert binary by using PHP's system function. After calling it, I got a return value of "126"; and 126 means, binary is found however it's not executable!..

I checked the binary in /opt/local/bin/convert and it has appropriate execute permissions, then I checked /opt/local/bin and /opt/local directories as well and they were executable too. However the catch was /opt folder's permission was 700!

I managed to execute chmod 755 /opt and magically error has gone.



Related Topics



Leave a reply



Submit