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

PIT: GIF Writer fails when writing a buffered image having an animated GIF

    XMLWordPrintable

Details

    • b43
    • generic
    • generic
    • Verified

    Description

      I am reading a trasparent animated GIF imagr from a file using Toolkit API and drawing it to an INT_RGB buffered image. Then I am writing this buffered image to a file using GIF Writer. When I run this application, I am getting an IOException. This happens only for the first frame in the image.

      This is reproducible on all platforms using the following PIT build:
      java version "1.6.0-2d.pit-jcg-win-03"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-2d.pit-jcg-win-03-java2d_25_may_2005_00_37-b00)
      Java HotSpot(TM) Client VM (build 1.6.0-ea-b37, mixed mode)

      Here is the exception:
      java.io.IOException: Bad palette length: 1!
      at com.sun.imageio.plugins.gif.GIFImageWriter.getNumBits(GIFImageWriter.java:133)
      at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:638)
      at com.sun.imageio.plugins.gif.GIFImageWriter.write(GIFImageWriter.java:487)
      at WriterTest.createBufferedImage(WriterTest.java:99)
      at WriterTest.<init>(WriterTest.java:46)
      at WriterTest.main(WriterTest.java:111)

      I have attached a sample test and a sample image. Run the test as follows:
      java WriterTest gif animdog.gif
      You would see the IOException on the console.
      ###@###.### 2005-05-26 16:42:48 GMT

      Attachments

        Activity

          People

            bae Andrew Brygin
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: