-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
6
-
generic
-
generic
I am creating a buffered image from the default GraphicsConfiguration by calling GC.createCompatibleImage(). I am rendering some 2D shapes into the buffered image and trying to write this buffered image to a file using GIF Writer, using the default Image Metadata. GIFWriter.writeToSequence() throws a NullPointerException as follows:
java.lang.NullPointerException
at com.sun.imageio.plugins.common.PaletteBuilder.findPaletteEntry(PaletteBuilder.java:310)
at com.sun.imageio.plugins.common.PaletteBuilder.getIndexColorModel(PaletteBuilder.java:296)
at com.sun.imageio.plugins.common.PaletteBuilder.getIndexedImage(PaletteBuilder.java:145)
at com.sun.imageio.plugins.common.PaletteBuilder.createIndexedImage(PaletteBuilder.java:77)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:573)
at com.sun.imageio.plugins.gif.GIFImageWriter.writeToSequence(GIFImageWriter.java:521)
at GIFCreateImageTest.createAnimatedImage(GIFCreateImageTest.java:142)
at GIFCreateImageTest.<init>(GIFCreateImageTest.java:65)
at GIFCreateImageTest.main(GIFCreateImageTest.java:180)
This is reproducible on all platforms with Mustang-b43.
I have attached a sample test. Execute the sample test. YOu would see the above exception on the console.
java.lang.NullPointerException
at com.sun.imageio.plugins.common.PaletteBuilder.findPaletteEntry(PaletteBuilder.java:310)
at com.sun.imageio.plugins.common.PaletteBuilder.getIndexColorModel(PaletteBuilder.java:296)
at com.sun.imageio.plugins.common.PaletteBuilder.getIndexedImage(PaletteBuilder.java:145)
at com.sun.imageio.plugins.common.PaletteBuilder.createIndexedImage(PaletteBuilder.java:77)
at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:573)
at com.sun.imageio.plugins.gif.GIFImageWriter.writeToSequence(GIFImageWriter.java:521)
at GIFCreateImageTest.createAnimatedImage(GIFCreateImageTest.java:142)
at GIFCreateImageTest.<init>(GIFCreateImageTest.java:65)
at GIFCreateImageTest.main(GIFCreateImageTest.java:180)
This is reproducible on all platforms with Mustang-b43.
I have attached a sample test. Execute the sample test. YOu would see the above exception on the console.
- duplicates
-
JDK-6287936 Writing an empty ARGB BufferedImage using GIF Writer throws NullPointerException
- Closed