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

WBMPImageWriterSpi.canEncodeImage() does not return the correct value for some buffered images

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:

      Description

      I am reading an animated GIF image through ImageIO.read() method. This method returns me the first image frame available in the input stream. I am creating a TypeSpecifier out of this buffered image. I am getting the WBMP Image Writer SPI and calling canEncodeImage(rendered img) as well as canEncodeImage(type specifier). I expect these methods to return false since the given image is not a single-band bilevel image. But these methods return 'TRUE' claiming that WBMP writer would support this image.

      But when I write this image using the WBMP Writer, I am getting an exception saying WBMP writer supports only single-band bilevel image. This is incorrect. SPI.canEncodeImage() should properly notify this when the writer does not support it.

      This is reproducible on Tiger as well as Mustang on all platforms.

      I have attached a sample test. Execute the sample test as follows:
      java WBMPWriteTest kiwi.gif

      If you see 'true' value returned by both the 'canEncodeImage()' methods and an exception being thrown by the image writer, bug is reproduced.

        Attachments

          Activity

            People

            Assignee:
            jdv Jayathirth D V
            Reporter:
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Imported:
              Indexed: