Page 1 of 1

validate fails on png tests

Posted: 2010-04-21T06:52:58-07:00
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.

Re: validate fails on png tests

Posted: 2010-04-21T07:57:27-07:00
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.

Re: validate fails on png tests

Posted: 2010-04-21T08:39:32-07:00
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.

Re: validate fails on png tests

Posted: 2010-04-21T08:43:10-07:00
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.

Re: validate fails on png tests

Posted: 2010-04-21T09:03:28-07:00
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.

Re: validate fails on png tests

Posted: 2010-04-29T00:12:52-07:00
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.