libpng icon indicating copy to clipboard operation
libpng copied to clipboard

libpng warning: sRGB: out of place !

Open sunmooncode opened this issue 1 year ago • 10 comments

This error appeared when I used the Python running program, where does this warning come from and how do I get rid of it?

sunmooncode avatar Jul 24 '23 08:07 sunmooncode

The warning indicates that a chunk (sRGB in this case) is in the wrong place in the PNG file/datastream. The file or stream needs to be fixed. The sRGB chunk has to occur before both PLTE and the actual data (IDAT), as do all encoding chunks (gAMA, cHRM, ICC chunks etc.)

jbowler avatar Jul 30 '23 23:07 jbowler

I need your help! I keep getting this warning message when I try to access a lot of data, and some of the images are causing it to pop up. Can you suggest any steps I can take to remove or temporarily disable this warning?

sunmooncode avatar Jul 31 '23 01:07 sunmooncode

This is nothing to do with libpng; libpng makes a function call in response to an image with a detectably misplaced chunk (sRGB in this case). You need to identify the program making the bogus images and report a bug there. As for the warnings the handling is a choice of the app you are using, apparently Python; talk to the devs of the Python reading code you are using.

In other words this is not a libpng issue.

jbowler avatar Jul 31 '23 03:07 jbowler

@ctruta - not-a-bug, by-design, as-intended, etc. On the other hand if the WC3 current proposals are accepted pngtest.png will become an invalid PNG.

I suggest that libpng get out of the business of being the PNG police; delete all the warnings and handle all the errors. It will serve you much better than having libpng being the boot boy.

jbowler avatar Mar 28 '24 22:03 jbowler