-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
None
-
beta
-
generic
-
generic
The following test case will allow the BufferedImage to be constructed
but will throw an InternalError from the 2D implementation when a
Graphics object is fetched from the image.
import java.awt.image.IndexColorModel;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.WritableRaster;
import java.awt.image.Raster;
public class BytePackedICMTest {
static byte vals[] = { 0, -1 };
public static void main(String args[]) {
IndexColorModel icm = new IndexColorModel(8, 2, vals, vals, vals);
WritableRaster raster =
Raster.createPackedRaster(DataBuffer.TYPE_BYTE,
1, 1, 1, 1, null);
BufferedImage bi = new BufferedImage(icm, raster, false, null);
bi.getGraphics().dispose();
}
}
but will throw an InternalError from the 2D implementation when a
Graphics object is fetched from the image.
import java.awt.image.IndexColorModel;
import java.awt.image.BufferedImage;
import java.awt.image.DataBuffer;
import java.awt.image.WritableRaster;
import java.awt.image.Raster;
public class BytePackedICMTest {
static byte vals[] = { 0, -1 };
public static void main(String args[]) {
IndexColorModel icm = new IndexColorModel(8, 2, vals, vals, vals);
WritableRaster raster =
Raster.createPackedRaster(DataBuffer.TYPE_BYTE,
1, 1, 1, 1, null);
BufferedImage bi = new BufferedImage(icm, raster, false, null);
bi.getGraphics().dispose();
}
}