Some YCbCr encoded JPEGs have ColorSpaceType "RGB" in the standard metadata
See original GitHub issueThe following test resources fail to report correct color space using the standard metadata: jpeg/exif-jpeg-thumbnail-sony-dsc-p150-inverted-colors.jpg, jpeg/exif-pspro-13-inverted-colors.jpg and jpeg/no-jfif-ycbcr.jpg. The first two are Exif files, the last one is not (might be two different issues).
Update: The first two reads correctly, while the last one has inverted colors using the standard JPEGImageReader
. Seems the Exif segment presence makes the native code interpret color space correctly, even though the Java part does not (thus the incorrect value in the metadata).
The images are all non-subsampled, with component ids 1-3. That means they should be identified as YCbCr according to the metadata API doc:
If neither [JFIF or Adobe] marker segment is present […and the component count is 3 or 4…] the component ids are consulted. If these values are 1-3 for a 3-channel image, then the image is assumed to be YCbCr.
However, they are not…
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Should be fixed now, via 5cc201b4.
Seems the original JDK issue is actually fixed in Java 9: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/06f9a2bff766