pngcrush sRGB profile error
Brought to you by:
glennrp
Trying to use pngcrush on the attached "example.png" file, but it fails:
$ pngcrush --version
pngcrush 1.8.9, uses libpng 1.6.26 and zlib 1.2.8.1-motley
Check http://pmt.sf.net/
for the most recent version.
CPU time decode 0.000000, encode 0.000000, other 0.000000, total 0.000000 sec
$ pngcrush -ow -brute -fix -warn example.png
example.png: iCCP: Not recognizing known sRGB profile that has been edited
While converting example.png to pngout.png:
pngcrush caught libpng error:
known incorrect sRGB profile
What can be done to fix this?
This ticket may be closed. I have found a convenient solution on StackOverflow:
I'll leave it open for a little while. There is some interaction with libpng-1.6.26 (pngrutil.c) that I don't quite understand. pngrutil.c from libpng-1.6.25 doesn't exhibit the problem.
Fixed in the pngcrush GIT repo. It was necessary to restrict the new ADLER32-skipping feature to work only with IDAT chunks.
Thanks, confirming that it works:
On an unrelated note (which doesn't deserve its own ticket), I noticed that the resulting executable is not stripped. On my system, stripping removes more than 200K from pngcrush.exe. Is this not desirable for all Windows users downloading the binaries?
Thanks. I've added strip to my build script and replaced the 1.8.10 executables.