United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6399616 PIT:JPGReader throws exception when using TYPE_CUSTOM TypeSpecifier returned by Reader.getImageTypes
JDK-6399616 : PIT:JPGReader throws exception when using TYPE_CUSTOM TypeSpecifier returned by Reader.getImageTypes

Details
Type:
Bug
Submit Date:
2006-03-16
Status:
Closed
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2006-04-19
Component:
client-libs
OS:
generic
Sub-Component:
javax.imageio
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
I am calling JPEGImageReader.getImageTypes and it returns a type specifier with the buffered image type '0' (TYPE_CUSTOM). I am creating a buffered image out of this image type specifier and setting it as destination when reading the image. But JPEGImageReader throws an IIOException on the PIT build and image is not read.

Here is the exception:
vax.imageio.IIOException: Incompatible color conversion
at com.sun.imageio.plugins.jpeg.JPEGImageReader.checkColorConversion(JPEGImageReader.java:816)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:932)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:892)
at KannanImageIOTest.<init>(KannanImageIOTest.java:55)
at KannanImageIOTest.main(KannanImageIOTest.java:119)

This is reproducible only on the b77 PIT build and not reporducible on Mustang-b75. This exception is thrown on Solaris as well as Win32. Hence this is a regression introduced in Mustang. 

I have attached a sample test. Execute the sample test passing the image as a command line argument. If you see the above exception on the console, the bug is reproduced.

                                    

Comments
EVALUATION

This regression caused by fix for 4705399 where we remove color
 conversion (JPEGImageReader.java lines 783 -786) because it causes
 extra color conversion for images with embedded color profile.

 However, this conversion is requires when destination type defines
 different color space for images that do not contain embedded profile.
 In this case we should convert image data from sRGB (produced by
 decoder) to color space used in destination image. The only exception
 is the case of present ICC profile - in this case conversion will be
 performed when image will be painted.
                                     
2006-03-23



Hardware and Software, Engineered to Work Together