Page 1 of 1

'Exception 420: NoDecodeDelegateForThisImageFormat `PNG' @ error/constitute.c/ReadImage/501'

Posted: 2017-07-23T10:19:20-07:00
by Zork
I'm an Imagick & PerlMagick noob, so sorry if I'm missing something obvious.

When I run this code:

Code: Select all

use strict;
use warnings;
use Image::Magick;

foreach my $filename ('z.png', 'z.gif', 'z.jpg')
{
    my $image = Image::Magick->new();
    my $num_images_read = $image->Read($filename);
    print "\$num_images_read for '$filename' = '$num_images_read'\n";
}
I get this output:

Code: Select all

$num_images_read for 'z.png' = 'Exception 420: NoDecodeDelegateForThisImageFormat `PNG' @ error/constitute.c/ReadImage/501'
$num_images_read for 'z.gif' = 'Exception 420: NoDecodeDelegateForThisImageFormat `GIF' @ error/constitute.c/ReadImage/501'
$num_images_read for 'z.jpg' = 'Exception 420: NoDecodeDelegateForThisImageFormat `JPEG' @ error/constitute.c/ReadImage/501'
The 3 files are valid PNG/GIF/JPG files.

Any ideas why Imagick can't read such basic file types?

Thanks.

============================================================================

Some installation & configuration details:-

I'm running ActivePerl 5.20 on Windows 7 SP 1.

I installed PerlMagick 6.89-1 using ActiveState's ppm. Details are:

Code: Select all

PerlMagick
ImageMagick PERL Extension
	Version:	6.89-1
	Released:	2014-09-21
	Author:	Cristy <email address remvoved>
	CPAN:	http://search.cpan.org/dist/PerlMagick-6.89-1/

Installed files:
	C:/Perl/html/site/lib/Image/Magick.html
	C:/Perl/site/lib/Image/Magick.pm
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_Magick++_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_bzlib_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_cairo_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_exr_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_glib_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_jp2_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_jpeg_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_lcms_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_librsvg_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_libxml_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_lqr_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_magick_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_openjpeg_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_pango_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_png_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_tiff_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_ttf_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_wand_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_webp_.dll
	C:/Perl/site/lib/auto/Image/Magick/CORE_RL_zlib_.dll
	C:/Perl/site/lib/auto/Image/Magick/Magick.dll
	C:/Perl/site/lib/auto/Image/Magick/autosplit.ix
	C:/Perl/site/lib/auto/Image/Magick/mfc120u.dll
	C:/Perl/site/lib/auto/Image/Magick/msvcp120.dll
	C:/Perl/site/lib/auto/Image/Magick/msvcr120.dll
	C:/Perl/site/lib/auto/Image/Magick/vcomp120.dll
	C:/Perl/site/lib/auto/PerlMagick/.packlist
Folder "C:\Perl\site\lib\auto\Image\Magick" contains 26 files including Magick.dll:

Code: Select all

c:\tmp> dir "C:\Perl\site\lib\auto\Image\Magick"

 Directory of C:\Perl\site\lib\auto\Image\Magick

13/09/2016  06:42    <DIR>          .
13/09/2016  06:42    <DIR>          ..
13/09/2016  06:42    <DIR>          Thumbnail
13/09/2016  06:34                94 autosplit.ix
13/09/2016  06:34            56,832 CORE_RL_bzlib_.dll
13/09/2016  06:34         1,156,608 CORE_RL_cairo_.dll
13/09/2016  06:34         3,399,680 CORE_RL_exr_.dll
13/09/2016  06:34         1,970,176 CORE_RL_glib_.dll
13/09/2016  06:34           187,904 CORE_RL_jp2_.dll
13/09/2016  06:34           322,560 CORE_RL_jpeg_.dll
13/09/2016  06:34           251,904 CORE_RL_lcms_.dll
13/09/2016  06:34           446,976 CORE_RL_librsvg_.dll
13/09/2016  06:34           297,984 CORE_RL_libxml_.dll
13/09/2016  06:34            47,104 CORE_RL_lqr_.dll
13/09/2016  06:34         1,520,640 CORE_RL_magick_.dll
13/09/2016  06:34           487,936 CORE_RL_Magick++_.dll
13/09/2016  06:34           161,280 CORE_RL_openjpeg_.dll
13/09/2016  06:34           294,400 CORE_RL_pango_.dll
13/09/2016  06:34           156,672 CORE_RL_png_.dll
13/09/2016  06:34           363,008 CORE_RL_tiff_.dll
13/09/2016  06:34           480,256 CORE_RL_ttf_.dll
13/09/2016  06:34           694,272 CORE_RL_wand_.dll
13/09/2016  06:34           388,096 CORE_RL_webp_.dll
13/09/2016  06:34            68,608 CORE_RL_zlib_.dll
13/09/2016  06:34           310,272 Magick.dll    <<<<<<<<<<
13/09/2016  06:34         4,449,952 mfc120u.dll
13/09/2016  06:34           455,328 msvcp120.dll
13/09/2016  06:34           970,912 msvcr120.dll
13/09/2016  06:34           119,456 vcomp120.dll
              26 File(s)     19,058,910 bytes
               3 Dir(s)  32,771,440,640 bytes free
I have set MAGICK_CODER_MODULE_PATH=C:\Perl\site\lib\auto\Image\Magick

I have NOT installed the command line version of Imagick (EDIT: I meant ImageMagick) a as I understand that is not necessary.

Thanks

Re: 'Exception 420: NoDecodeDelegateForThisImageFormat `PNG' @ error/constitute.c/ReadImage/501'

Posted: 2017-07-23T11:19:42-07:00
by snibgo
Zork wrote:I have NOT installed the command line version of Imagick as I understand that is not necessary.
Is Imagick relevant? Perhaps you mean ImageMagick (they are two different things).

The ImageMagick command line tools would help to diagnose your problem. For example, "convert -version" would tell you whether PNG is a built-in delegate, and "convert -debug all ..." would tell you where it was searching for its files.

Perhaps you can get this information without the CLI tools.

Re: 'Exception 420: NoDecodeDelegateForThisImageFormat `PNG' @ error/constitute.c/ReadImage/501'

Posted: 2017-07-23T11:29:53-07:00
by Zork
You're right, I meant ImageMagick.