validate fails on png tests

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

validate fails on png tests

Post by axelrose »

Hi all,

with IM 6.6.1-4 under MacOS 10.6.3 "make check" runs forever with
tests/validate-formats-in-memory

Code: Select all

make  check-TESTS check-local
...
PASS: tests/validate-pipe.sh
PASS: tests/validate-stream.sh
<doesn't continue here, ctrl-c after 20 minutes>
The last lines of "validate-formats-in-memory.log-t" show this:

Code: Select all

  test 218: ICON/Undefined/TrueColor/10-bits... pass.
  test 219: ICON/Undefined/TrueColovalidate: Application was compiled with png.h from libpng-1.2.43 `' @ warning/png.c/PNGWarningHandler/1457.
validate: Application  is  running with png.c from libpng-1.4.1 `' @ warning/png.c/PNGWarningHandler/1457.
validate: Incompatible libpng version in application and library `' @ warning/png.c/PNGWarningHandler/1457.
validate: memory allocation failed `' @ error/png.c/WriteOnePNGImage/6436.
Which application is used here?

I compiled my own libpng-1.4.1 but perhaps the system still has a 1.2.43 installation somewhere.

Where could I find the actual test code in the sources?


Thanks for your help,
Axel.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: validate fails on png tests

Post by magick »

It appears you have compiled against one version of the PNG header but linked another. Make sure your PNG header and libraries are compatible.
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: validate fails on png tests

Post by axelrose »

I do not manage to avoid this problem.

I compiled libpng-1.4.1 into "/mydir". "/mydir/include/png.h" is the libpng-1.4.1 header file.
"/mydir/lib" contains "libpng14.dylib".

I compiled ImageMagick with

LD_LIBRARY_PATH=/mydir

and

CPPFLAGS=-I/mydir/include LDFLAGS=-L/mydir/lib

"make" is successful and "otool -L utilities/.libs/convert" displays as png lib
"/mydir/lib/libpng14.14.dylib (compatibility version 16.0.0, current version 16.0.0)"

I still believe this is something different, because the last error reported is
"validate: memory allocation failed `' @ error/png.c/WriteOnePNGImage/6436."
Probably this is the root cause at the moment.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: validate fails on png tests

Post by magick »

You can get a memory error if the PNG header is not compatible with the PNG library. There might be a structure offset so the PNG structure members do not align. We are confident if your PNG header matches the PNG library version included in the ImageMagick build, you will be able to read / write PNG images without complaint.
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: validate fails on png tests

Post by axelrose »

Yes, the code seems to be clear.

But how could I check my compilation otherwise as done above?

Also illogical to me is that other tests on the same format do work

Code: Select all

  test 217: ICON/Undefined/ColorSeparationMatte/8-bits... pass.
  test 218: ICON/Undefined/TrueColor/10-bits... pass.
  test 219: ICON/Undefined/TrueColovalidate: Application was compiled with png.h from libpng-1.2.43 `' @ warning/png.c/PNGWarningHandler/1457.
axelrose
Posts: 96
Joined: 2008-12-16T06:01:27-07:00

Re: validate fails on png tests

Post by axelrose »

I finally succeeded after setting PATH to a minimum.

My PATH contained paths to other packages which used libpng12. It's mysterious that
this took precedens over ./configure LIBS=-lpng14 LDFLAGS=/path/to/my/libpng14dir

Best,
Axel.
Post Reply