-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
5.0
-
generic
-
generic
I am reading a jpeg image which is created by ImageIO by color convering a TYPE_INT_BGR from sRGB colorspace to CS_GRAY color space. When inspecting this image, JPEG Reader returns 2 image types as supported - TYPE_BYTE_GRAY and TYPE_3BYTE_BGR. When I used TYPE_3BYTE_BGR as the destination type, I am getting an IllegalArgumentException saying source and destination bands differ. This is incorrect. The image should be decodable using all image types returned by getImageTypes().
This is reproducible atleast since 1.5 on all platforms.
I have attached a sample image and a test case. Run the testcase passing the attached image on the command line. If you get the following exception, the bug is reproduced.
java.lang.IllegalArgumentException: ImageReadParam num source & dest bands differ!
at javax.imageio.ImageReader.checkReadParamBandSettings(ImageReader.java:2746)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:958)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:915)
at KannanImageIOTest.<init>(KannanImageIOTest.java:107)
at KannanImageIOTest.main(KannanImageIOTest.java:165)
This is reproducible atleast since 1.5 on all platforms.
I have attached a sample image and a test case. Run the testcase passing the attached image on the command line. If you get the following exception, the bug is reproduced.
java.lang.IllegalArgumentException: ImageReadParam num source & dest bands differ!
at javax.imageio.ImageReader.checkReadParamBandSettings(ImageReader.java:2746)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:958)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:915)
at KannanImageIOTest.<init>(KannanImageIOTest.java:107)
at KannanImageIOTest.main(KannanImageIOTest.java:165)
- duplicates
-
JDK-4893408 JPEGReader throws IllegalArgException when setting the destination to BYTE_GRAY
-
- Resolved
-