PNG not Working on Ubuntu Even with Lib

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
pgn674
Posts: 11
Joined: 2009-03-20T07:49:27-07:00
Authentication code: 8675309

PNG not Working on Ubuntu Even with Lib

Post by pgn674 »

I've downloaded ImageMagick-6.6.1-9.tar.gz and PerlMagick-6.59.tar.gz to compile and install on my Ubuntu Server 9.04. I can't simply install it from the repositories as that version has a bug where SetPixel always sets blue to 255. I'm following the ImageMagick and PerlMagick instructions:
ImageMagick: Install from Source
ImageMagick: PerlMagick, Perl API for ImageMagick

I have both the libpng12-0 and libpng12-dev packages installed. When I do ./configure for ImageMagick, it says "PNG --with-png=yes yes". "make check" says "All 12 tests passed", though nothing specifically mentions PNG. BTW, make check takes a very long time. I ran it using time, and I got real 49m5.795s, user 0m59.364s, sys 1m49.751s.

Now onto PerlMagick. Makefile.PL already has -I/usr/include/libpng12 in the $INC_magick variable, and that is a real directory on my system containing a couple *.h files. But after installing, make test here says

Code: Select all

Failed Test      Stat Wstat Total Fail  List of Failed
t/png/read-16.t                 5    5  1-5
t/png/read.t                    6    6  1-6
t/png/write-16.t                5    5  1-5
t/png/write.t                   6    6  1-6
And when I try running a program that writes to a PNG file, it errors out with "Exception 420: no encode delegate for this image format `/[redacted]/colorcube.png' @ error/constitute.c/WriteImage/1152 at /usr/lib/cgi-bin/colorcubeslice.pl line 66."

So, does anyone know why PNG isn't working, or can anyone point me in a direction on finding out?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG not Working on Ubuntu Even with Lib

Post by fmw42 »

Sorry, I know little about PerlMagick

try

convert logo: logo.png

Does that work?


try

convert -list configure

look at line starting with DELEGATES. Does it include png? If not, then libpng was not installed correctly or prior to installing IM or you have multiple versions that are getting IM confused.
pgn674
Posts: 11
Joined: 2009-03-20T07:49:27-07:00
Authentication code: 8675309

Re: PNG not Working on Ubuntu Even with Lib

Post by pgn674 »

fmw42 wrote:convert logo: logo.png
Yup, that completes with no errors or any output at all.
convert -list configure
Gives "DELEGATES png zlib". I noticed it also gives "LIBS -lMagickCore -lpng -lz -lm -lgomp -lpthread".
pgn674
Posts: 11
Joined: 2009-03-20T07:49:27-07:00
Authentication code: 8675309

Re: PNG not Working on Ubuntu Even with Lib

Post by pgn674 »

pgn674 wrote:
fmw42 wrote:convert logo: logo.png
Yup, that completes with no errors or any output at all.
Whoops, spoke too soon. The resulting file, while not 0 bytes, seems to not be a valid PNG image. And, when I run "convert logo: logo.png -debug", I get "convert: no decode delegate for this image format `logo.png' @ error/constitute.c/ReadImage/532."
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PNG not Working on Ubuntu Even with Lib

Post by fmw42 »

Might you have two different versions of libpng and so some confusion where IM thinks it resides. Other than that, you probably need help from the IM folks about configuring PerlMagick
pgn674
Posts: 11
Joined: 2009-03-20T07:49:27-07:00
Authentication code: 8675309

Re: PNG not Working on Ubuntu Even with Lib

Post by pgn674 »

I did accidentally leave the perlmagick package installed when I went to compile and install manually the first time. But then I uninstalled the package, uninstalled the manual stuff, then recompiled and reinstalled the manual stuff, but this is still happening.
pgn674
Posts: 11
Joined: 2009-03-20T07:49:27-07:00
Authentication code: 8675309

Re: PNG not Working on Ubuntu Even with Lib

Post by pgn674 »

I got it working. I tried doing "make uninstall" on both ImageMagick and PerlMagick again, and then I saw that "make check" on ImageMagick still worked. So I deleted both directories that the *.tar.gz files had recompressed into, then redecompressed those files and reinstalled as before. And now, it works. My program runs OK, and "make test" on PerlMagick says that PNG is OK.
Post Reply