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

JPEGIWP.setCompressionMode() should throw exception for MODE_DISABLED

XMLWordPrintable

      The API doc for setCompressionMode() claims that certain writers such as JPEG do not normally offer uncompressed output and hence the corresponding set / get methods would throw an IllegalStateException. But when I passed MODE_DISABLED to JPEGWriteParam.setCompressionMode(), it does not throw any exception and accepts the mode specified by me. But eventually when using the writer to write an image, an IIOException is thrown saying this writer can not offer uncompressed output. Hence MODE_DISABLED must be rejected in the setCompressionMode() itself.

      This is reproducible right from JDK1.4 on all the platforms.

      I have attached a sample code. Execute the sample code & watch the console. If you see a 'FAIL' message then the bug is reproduced.

      ###@###.### 2003-12-23

      Attached the testcase.

      ###@###.### 2003-12-23

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

              Created:
              Updated:
              Imported:
              Indexed: