Windows 7 php no decode delegate for this image format `PNG'

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ViacheslavG
Posts: 1
Joined: 2016-06-24T02:05:40-07:00
Authentication code: 1151

Windows 7 php no decode delegate for this image format `PNG'

Post by ViacheslavG »

Hi guys,

Stuck with connecting ImageMagic with php. Could you please let me know in what step I did wrong. I got error ImageMagick No decode delegate for this image format.

Platform Windows 7 x64

Php version 5.5.28x86VC11 TS
Visual studio Not sure but I think 2013

Steps I did:
1) Installed ImageMagick-7.0.2-0-Q16-x86-dll.exe checke all check boxes except "Install Perl for Strawberry Perl v520" - it cause a failure.
2) Downloaded php_imagick-3.4.3rc1-5.5-ts-vc11-x86.zip unpack it. Extracted php_imagick.dll and put under php/ext folder. Added extension=php_imagick.dll to php.ini.
3) Verifyied path variable contains (C:\Program Files (x86)\ImageMagick-7.0.2-Q16;)
4) Added MAGICK_HOME C:\Program Files (x86)\ImageMagick-7.0.2-Q16\ variable
5) Checked in cmd that ImageMagick works:

convert -version
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype jng jp2 jpeg lcms lqr openexr pangocairo png ps rsvg tiff webp xml zlib

convert logo: logo.gif
identify logo.gif
imdisplay logo.gif

Logo Image opened without any issues.

6. Reboot My PC.

7. run php code and get "Unable to load dynamic library 'ext\php_imagick.dll' - %1 is not a valid Win32 application.
in Unknown on line 0"

8. Copied dlls(all except php_imagick.dll) from php_imagick-3.4.3rc1-5.5-ts-vc11-x86.zip to c:\Program Files (x86)\ImageMagick-7.0.2-Q16\
9. Reboot PC
10. run php code and get no decode delegate for this image format `PNG' @ error/constitute.c/ReadImage/501.
11. From command line I easelly converted png to jpeg and vise versa

Code that cause the issue:
$img = new Imagick("D:\automationTests\background.png");

Also if I create $img = new Imagick(); All is ok. $img->newImage(100, 100, new ImagickPixel('red')); ok
$imagickImage->setImageFormat('png'); - says it can't find dll in C:\Users\'MyUser'\AppData\Local\ImageMagick. Can't Understand why it try to look there the dll exist in C:\Program Files (x86)\ImageMagick-7.0.2-Q16.

Thanks in advance for any help. Please let me know if you need more info.
Post Reply