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

Behavior is unspecified when comp mode is MODE_EXPLICIT and compression type is NULL.

XMLWordPrintable

      I am setting the compression mode to MODE_EXPLICIT and setting the compression type to NULL in the ImageWriteParam. In this case, when I write an image using this param, JPEG writer throws an IllegalStateException saying compression type is not set. But GIF Writer does not throw any exception and continues to write the image. For BMP, the image is written without any exception. But for BMP, it is documented in the BMPWriteParam that if getCompressionType() returns null, writer will choose a suitable compression type. There is nothing documented for GIF/JPEG.

      Would be good to document what would be the expected behavior in the following cases:
      1. Compression mode is MODE_EXPLICIT and compression type is NULL
      2. Compression mode is MODE_DEFAULT and compression type is Null or invalid.

      This is reproducible on all platforms since Tiger. I have attached a sample test which would demonstrate the first issue described above.
      ###@###.### 2005-07-13 10:38:28 GMT

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

              Created:
              Updated:
              Imported:
              Indexed: