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

JDK javax.imageio ImageWriters do not all flush the output stream

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • 26
    • client-libs
    • None

      The JDK's ImageIO PNG, BMP, WBMP and JPG writers call ImageOutputStream.flush() before returning. The TIFF and GIF ones do not.

      This means that if an application then closes the underlying java.io.OutputStream that the TIFF and GIF image data can't be flushed.

      This ought not to be a problem for a correct application - which should call
      ImageOutputStream.close() before calling java.io.OutputStream.close()

      And arguably the PNG, BMP, WBMP and JPG writers are just rewarding that bad behavior.
      But also arguably the writers should all call ImageOutputStream.flush() when they are done with a complete image.

            prr Philip Race
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: