Page 1 of 1

convert and identify fails with known incorrect sRGB profile

Posted: 2014-07-08T09:18:16-07:00
by olafkarsten
IM fails sometimes when working with png images with wrong profiles.
This isn't a new issue. In earlier versions, identify issues a warning and send and cli return code 0. Thats okay and one can work around the warnings. In the current version (stable and beta) this isn't the case anymore. IM returns cli code 1 and fails.

Identify returns the info's, though sends cli return code 1.

This issue indicates, that it shouldn't happen anymore.
viewtopic.php?f=3&t=25809
014-06-28 6.8.9-5 Glenn Randers-Pehrson <glennrp@image...>
Do not let libpng16 check ICC/sRGB profiles in non-debug runs; we do it ourselves anyway. Avoids emitting "known incorrect profile" warnings. For strict profile checking and warning, use "-debug coder".
+regard-warnings doesn't help.


In the changelogs I found a hint to use -define profile:skip=icc, and that works.
2014-06-25 6.8.9-5 Cristy <quetzlzacatenango@image...>
Use -define profile:skip=icc, for example, to skip color profiles on read.
identify icc-broken.png
icc-broken.png PNG 1969x1969 1969x1969+0+0 8-bit sRGB 448KB 0.000u 0:00.000
identify: iCCP: known incorrect sRGB profile `icc-broken.png' @ warning/png.c/MagickPNGWarningHandler/1831
$ echo $?
1

identify -define profile:skip=icc icc-broken.png
icc-broken.png PNG 1969x1969 1969x1969+0+0 8-bit sRGB 448KB 0.010u 0:00.000
$ echo $?
0

if you need the image: http://we.tl/now47r44Ve

Re: convert and identify fails with known incorrect sRGB pro

Posted: 2014-07-08T10:04:03-07:00
by glennrp
Are you using libpng-1.6.12? The feature for skipping the sRGB profile-checking was added to libpng-1.6.12; earlier versions will continue to issue the warning.

Re: convert and identify fails with known incorrect sRGB pro

Posted: 2014-07-08T11:51:55-07:00
by olafkarsten
Ah, you are right, that fixed the problem. Thanks.

I wouldn't expect such an hard fail, if I didn't have the latest libpng installed. The earlier behavior: issuing a warning but returning cli code 0 is somewhat more friendly. I didn't know enough about installing, configure and make files - Would it be possible to check that during installation and give a warning about libraries that are to old?

Is there somewhere a place where I can read which are the required dependencies?