Created attachment 467577 [details]
Test program showing the problem
Description of problem:
Some JPEGs with sRGB IEC61966-2.1 color profiles have completely wrong colors when loaded by ImageIO. The problem appears to afflict only OpenJDK---I can't reproduce this with the same images on Windows XP with Oracle's 6 Update 22.
Every other program I use to open bad.jpg displays it properly. This could be because ImageIO has a bug, or it could be because bad.jpg is broken, but ImageIO handles the brokenness differently from other programs. (I haven't been able to find any way to determine whether the image is a valid JPEG.)
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. java Test good.jpg
2. java Test bad.jpg
bad.jpg has incorrect colors (it's purplish instead of greenish).
If bad.jpg is ok, then it should look like good.jpg. If bad.jpg is actually broken, then ImageIO should complain.
Created attachment 467578 [details]
The bad image
Created attachment 467579 [details]
The good image
Created attachment 467584 [details]
A screenshot of the bad image looking purple instead of green
The proprietary JDK has a proprietary colour management system which was never released as open source. OpenJDK uses LCMS, as do many other applications on the GNU/Linux platform.
(In reply to comment #4)
> The proprietary JDK has a proprietary colour management system which was never
> released as open source. OpenJDK uses LCMS, as do many other applications on
> the GNU/Linux platform.
GIMP uses LCMS, but the attached "bad" image has the correct colors in GIMP (and in every other application I've tried on Linux).
Do you know what version of LCMS is being used by GIMP? OpenJDK uses an in-tree version (due to local patching) which may have a bug that's been fixed in a newer version.
(In reply to comment #6)
> Do you know what version of LCMS is being used by GIMP?
No, I don't. The only way that I knew that GIMP was using LCMS at all was from a diagnostic message it spit out to my terminal after I chose the "Keep" option for the color profile while loading the image.
This was fixed in head and 1.10 by this changeset:
Finally fixed in 7: