-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
None
-
beta
-
generic
-
solaris_7
The regression test in test/javax/imageio/IRPTest.java attempts to simulate
the effects of an ImageReadParam on an image read by performing a read with
a null ImageReadParam and copying selected pixels from the result into a
new BufferedImage.
It must analyze the returned image and construct a new BufferedImage that
is capable of holding equivalent pixel values. In the case where the incoming
image had an IndexColorModel, it attempted to use the BufferedImage constructor
that takes a width, height, image type, and IndexColorModel. However, if
the incoming image had a type of BufferedImage.TYPE_BYTE_BINARY but actually
had more than 1 bit per pixel, this constructor will fail. (How the incoming
image received this type is a matter for separate investgation.)
In the non-IndexColorModel case, a constructor was used that takes a
width, height, and image type. However, if the incoming image had TYPE_CUSTOM,
this constructor will fail. A TYPE_CUSTOM image may be obtained from a
PNG Gray+Alpha color type, for example.
The solution is to use the constructor that takes a ColorModel and a
WritableRaster directly. The WritableRaster is created by calling
createCompatibleWritableRaster on the Raster of the incoming image.
the effects of an ImageReadParam on an image read by performing a read with
a null ImageReadParam and copying selected pixels from the result into a
new BufferedImage.
It must analyze the returned image and construct a new BufferedImage that
is capable of holding equivalent pixel values. In the case where the incoming
image had an IndexColorModel, it attempted to use the BufferedImage constructor
that takes a width, height, image type, and IndexColorModel. However, if
the incoming image had a type of BufferedImage.TYPE_BYTE_BINARY but actually
had more than 1 bit per pixel, this constructor will fail. (How the incoming
image received this type is a matter for separate investgation.)
In the non-IndexColorModel case, a constructor was used that takes a
width, height, and image type. However, if the incoming image had TYPE_CUSTOM,
this constructor will fail. A TYPE_CUSTOM image may be obtained from a
PNG Gray+Alpha color type, for example.
The solution is to use the constructor that takes a ColorModel and a
WritableRaster directly. The WritableRaster is created by calling
createCompatibleWritableRaster on the Raster of the incoming image.