Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4127399

PixelGrabber doesn't work with BufferedImage

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.0
    • client-libs
    • None
    • 2d
    • sparc
    • solaris

      I'm writing a program to graph data and write the result as a GIF file. To this end it graphs in a BufferedImage and uses a GIF-encoding class which extracts the pixels using java.awt.image.PixelGrabber (it was based on 1.1).

      However, when given this image PixelGrabber throws a NullPointerException. I'm sure there's other legacy code which will have the same problem.

      I've put together a small program which demostrarates the bug. When it runs, the exception trace is:

      java.lang.NullPointerException
              at java.awt.image.PixelGrabber.grabPixels(PixelGrabber.java:241)
              at java.awt.image.PixelGrabber.grabPixels(PixelGrabber.java:217)
              at PixelGrabberTest.main(PixelGrabberTest.java:68)

            jehung Jeannette Hung (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: