Perl Tutorials - Herong's Tutorial Examples - 6.00, by Dr. Herong Yang
Imager::File::PNG - PNG File Format
This section provides a tutorial example on how to install Imager::File::PNG Perl module using CPAN Shell. Installation failed with 'lpng' library missing.
Note that the Perl Imager module only supports bmp, ico, pnm, raw, sgi and tga image file formats.
If you try to write an image in PNG file format, you will get an error:
herong$ perl Imager-Convert-Format.pl sample.png format 'png' not supported - formats bmp, ico, pnm, raw, sgi, tga available for reading - Can't locate Imager/File/PNG.pm at Imager-Convert-Format.pl line 11.
To support PNG file format, you need to install the Imager::File::PNG module as suggested in the error message.
herong$ perl -MCPAN -e shell cpan> install Imager::File::PNG Running install for module 'Imager::File::PNG' Running make for T/TO/TONYC/Imager-File-PNG-0.94.tar.gz Fetching with LWP: http://cpan.mirrors.ovh.net/.../id/T/TO/TONYC/Imager-File-PNG-0.94.tar.gz ... CPAN.pm: Building T/TO/TONYC/Imager-File-PNG-0.94.tar.gz PNG: building independently PNG: Generic: includes not found - libraries not found ... PNG: base (+libz): includes not found - libraries not found ... PNG: Checking if the compiler can find them on its own Warning (mostly harmless): No library found for -lpng PNG: Test code failed: Can't link/include 'png.h', 'stdio.h', 'png' OS unsupported: PNG libraries or headers not found Warning: No success on command[/usr/bin/perl Makefile.PL] 'YAML' not installed, will not store persistent state TONYC/Imager-File-PNG-0.94.tar.gz /usr/bin/perl Makefile.PL -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install
Looks like the required "lpng" library is missing. So installation of Imager::File::PNG failed.
Table of Contents