-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
generic
-
generic
Setting the destination type to the first image type specifier returned from
reader.getImageTypes() throws an IIOException saying that the destination type does not match. This is noticed for GIF and PNG whereas it works fine for JPEG.
It is specified in the document that the first element of the iterator returned
by reader.getImageTypes() should be the most "natural" type for decoding the image with as little loss as possible. But when i try to read the image using an image read param with destinationType() set to the first element of the returned
iterator, the following exception is thrown.
javax.imageio.IIOException: Destination type from ImageReadParam does not match!
at javax.imageio.ImageReader.getDestination(ImageReader.java:2668)
at com.sun.imageio.plugins.gif.GIFImageReader.read(GIFImageReader.java:958)
at ImgParamReaderTest.start(ImgParamReaderTest.java:119)
at ImgParamReaderTest.<init>(ImgParamReaderTest.java:65)
at ImgParamReaderTest.main(ImgParamReaderTest.java:132)
This is noticed on all the platforms for Merlin-beta build 57.
I tried this with both the default param as well as newly created read param
and the result is same.
How to reproduce the bug :
Compile the attached .java file and run it. it will display the Sample Model and
Color Model of the ImageTypeSpecifier returned from getImagetypes() and also
it wil display the Color and Sample Model of the image read. If you get the
exception then the bug is reproduced.
reader.getImageTypes() throws an IIOException saying that the destination type does not match. This is noticed for GIF and PNG whereas it works fine for JPEG.
It is specified in the document that the first element of the iterator returned
by reader.getImageTypes() should be the most "natural" type for decoding the image with as little loss as possible. But when i try to read the image using an image read param with destinationType() set to the first element of the returned
iterator, the following exception is thrown.
javax.imageio.IIOException: Destination type from ImageReadParam does not match!
at javax.imageio.ImageReader.getDestination(ImageReader.java:2668)
at com.sun.imageio.plugins.gif.GIFImageReader.read(GIFImageReader.java:958)
at ImgParamReaderTest.start(ImgParamReaderTest.java:119)
at ImgParamReaderTest.<init>(ImgParamReaderTest.java:65)
at ImgParamReaderTest.main(ImgParamReaderTest.java:132)
This is noticed on all the platforms for Merlin-beta build 57.
I tried this with both the default param as well as newly created read param
and the result is same.
How to reproduce the bug :
Compile the attached .java file and run it. it will display the Sample Model and
Color Model of the ImageTypeSpecifier returned from getImagetypes() and also
it wil display the Color and Sample Model of the image read. If you get the
exception then the bug is reproduced.
- duplicates
-
JDK-4430788 SampleModel/ColorModel classes should implement equals(), hashCode()
-
- Resolved
-