Libpng code has code sections that screen for an old sRGB profile that libpng flags as “incorrect”, apparently on the grounds that using this old sRGB profile on non-Windows operating systems might violate somebody’s copyright. I’ve never found any text on the internet to confirm that “someone” put such a restrictive copyright on this particular sRGB profile. This profile is embedded in many, many images posted to the web and is still being used on even relatively new Windows machines and so is still being embedded in images posted to the web. It’s a very difficult profile to avoid.
libpng has additional code that screens for the possibility that someone might have modified the sRGB profiles that can be downloaded from color.org.
So there’s nothing “incorrect” about profiles flagged by libpng, except that libpng is playing “profile police”.
On the one hand, I agree 100% that people should respect copyrights.
On the other hand, as far as I know no-one has ever provided the actual written copyright that would indicate that one particular widely used sRGB profile “shouldn’t” be used on non-Windows systems.
The libpng furor over that profile and other profiles has taken the additional stance that the profiles are no good because they violate the ICC profile specs. Well, the particular sRGB profile I mentioned above does violate the V4 specs, but it doesn’t violate the V2 specs, and when the profile was made, V4 specs didn’t exist.
Except that this particular widely used sRGB profile and also many, many other V2 profiles in circulation do violate the the latest version of the V2 specs, which were “updated” by the ICC to reflect V4 specs. This is a case of “rewriting history to suit the winners” as there was a great deal of debate over how to handle absolute colorimetric intent. The outcome of this debate is why a lot of software still uses V2 ICC profiles interpreted according to “non-updated” V2 specs.
Obviously the swapped primaries make the profile in the referred to test image in some sense “broken”, but that’s not up to libpng to decide, and I suspect that’s not the actual or only reason the profile in the test image gets flagged by libpng.
I would suggest two things:
If you want to modify a profile, make sure the profile copyright allows to do this. My github ICC profiles and code have appropriate free/libre licenses for modifying both the code and the provided profiles.
If you are a software developer, please read through the following GIMP bug reports and libpng discussions - the order listed is the order in which the conversations took place - and decide for yourself how you want to handle libpng warnings. But I urge you to disable these warnings to the point where they don’t even print to the terminal (this is possible to do). Color management is difficult enough, and users shouldn’t have to deal with bogus/useless/misleading/uninformative libpng warnings.
-
Bug 721135 – Unable to export to .png - libpng error: known incorrect sRGB profile (it’s a long read, but worth reading) - Unable to export to .png - libpng error: known incorrect sRGB profile
-
PNG and MNG/JNG image formats: home site / [png-mng-implement] Libpng shouldn't check ICC profiles for possible license violations - Libpng shouldn’t check ICC profiles for possible license violations
-
Bug 765850 – Deal with libpng error gracefully when exporting an image with the color profile "sRGB IEC61966-2.1" - Deal with libpng error gracefully when exporting an image with the color profile “sRGB IEC61966-2.1”