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

ImageIO.getImageWriter(reader) returns null for PNG

XMLWordPrintable

    • beta2
    • generic
    • generic
    • Verified

      ImageIO.getImageWriter(reader) should return the preferred writer that can
      encode the image read by the reader specified. But the above method returns
      Null for PNG reader instead of returning the preferred writer for PNG.

      Documentation says that this method returns the "preferred" writer, which is the
      first in the list returned by javax.imageio.spi.ImageReaderSpi. getImageWriterSpiNames(). getImageWriterSpiNames() returns the corresponding
      PNG writer perfectly when invoked with respect to the PNG readerSpi but still
      getImageWriter() method fails.

      Herewith I have attached the sample code which reproduces this bug.
      Compile and run the sample code. You will get a frame with a load button.
      Click the load button. if you see the message 'writer is null' at the prompt
      then the bug is reporduced.

      This works fine for JPEG.
      I noticed this in Merlin-beta build 61.

            dricesunw Daniel Rice (Inactive)
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: