convert and identify fails with known incorrect sRGB profile

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

convert and identify fails with known incorrect sRGB profile

Post 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
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: convert and identify fails with known incorrect sRGB pro

Post 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.
olafkarsten
Posts: 29
Joined: 2013-06-13T08:35:38-07:00
Authentication code: 6789

Re: convert and identify fails with known incorrect sRGB pro

Post 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?
Post Reply