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

JPEG Writer throws exception when writing a buff image color converted to CS_PYCC

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

      I have a buffered image which I am filtering through ColorConvertOp with source color space set to sRGB and dest color space set to CS_PYCC. I am trying to save the output image to a file using JPEG Writer and JPEG Writer throws the following exception -

      javax.imageio.IIOException: Bogus input colorspace
      at com.sun.imageio.plugins.jpeg.JPEGImageWriter.writeImage(Native Method)
      at com.sun.imageio.plugins.jpeg.JPEGImageWriter.write(JPEGImageWriter.java:996)
      at javax.imageio.ImageWriter.write(ImageWriter.java:598)
      at javax.imageio.ImageIO.write(ImageIO.java:1479)
      at javax.imageio.ImageIO.write(ImageIO.java:1521)
      at ColorConvertTest.doTest(ColorConvertTest.java:267)
      at ColorConvertTest.<init>(ColorConvertTest.java:112)
      at ColorConvertTest.main(ColorConvertTest.java:484)

      JPEG Writer throws the above exception for the following buffered image types when the destination color space is CS_PYCC (whatever may be the source color space) -
      TYPE_BYTE_GRAY
      TYPE_INT_RGB
      TYPE_INT_BGR
      TYPE_3BYTE_BGR
      TYPE_USHORT_555_RGB
      TYPE_USHORT_565_RGB

      JPEG Writer throws the above exception for the following buffered image types when the dest color space is CS_GRAY (regardless of src color space) -
      TYPE_INT_ARGB
      TYPE_INT_ARGB_PRE
      TYPE_4BYTE_ABGR
      TYPE_4BYTE_ABGR_PRE
      TYPE_BYTE_BINARY
      TYPE_BYTE_INDEXED

      This is reproducible on win32 as well as sol10 atleast since 1.5+.

      I have attached a sample test which reproduces the above issue for TYPE_INT_RGB with CS_PYCC color space. Run the attached test and you will get the exception on the console.

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

              Created:
              Updated:
              Imported:
              Indexed: