I am trying to read a user-downloaded JPEG image (arbitrary) to create a thumbnail in a server application. The system works fine on Windows7 / Oracle Java 8u11, but I have a problem with the CentOS color model on the server:
source image:
http://studio-st.ru/media/portfolio/image/45
created thumbnail on Windows development workstation is absolutely correct
the result under Linux shifts in color (reddish on Java 8u05, with a color change on Java 8u11). Not presented here because the original example was on a site that has been fixed.
A deeper study showed that the problem is reading the image - ImageIO.read (inputStream) on Windows and Linux returns image objects with exactly the same parameters, however, the getRGB (x, y) color probe for the same image (just read ) returns different values.
The colors processed on Linux differ on Java 8u05 and 8u11, 8u05 were "reddish", 8u11, as shown above.
This has nothing to do with alpha channels - this particular source image is JPEG Type 5 (TYPE_3BYTE_BGR) exported from Adobe Lightroom with conversion to sRGB without any other tricks.
It also affects all images exported at this time (in fact, all images on this site).
Can anyone give some advice on how to make it work (except waiting for a fix for the JDK)? Perhaps recommend an alternative library that can be used here (EJB, data stored in MongoDB, so data is extracted using InputStreams - without access to the file system).
Thanks!
UPD: the problem seems to be related to the new Java8 color management module - it does not understand this image format. The problem with switching to the old CMM. Please see the details in the correct comment below.