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
How to Make My PHP Script Run at a Certain Time Everyday
How to Use a PHP Includes Across Multiple Directories/Sub Directories with Relative Paths
Compare Two Version Strings in PHP
Warning: File_Get_Contents: Failed to Open Stream: Redirection Limit Reached, Aborting
Asynchronous Http Requests in PHP
$_Post Empty on Utf-8 Characters
How to Change the Sequence of 'Joins' in Cakephp
Php: "Short_Open_Tag = On" Not Working
PHP Readfile() Adding Extra Bytes to Downloaded File
Optional Parameter in the Middle of a Route
How to Determine the Extension(S) Associated with a Mime Type in PHP
How to Detect Ambiguous and Invalid Datetime in PHP
I Want a Pagination to My Options Page of Wordpress Plugin
Is There a Difference Between Instantiation with Parentheses or Without
How to Verify the Requesting Server in PHP
Extending Session Timeout in PHP via the .Htaccess