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

JPG, PNG, TIFF fails to encode translucent images with CS_PYCC color space

    XMLWordPrintable

    Details

      Backports

        Description

        I am creating a buffered image with an alpha channel (say TYPE_INT_ARGB) and converting it to CS_PYCC color space through ColorConvertOp. When I try to save the converted image to a file using JPEG, I get the following exception -

        javax.imageio.IIOException: Huffman table 0x01 was not defined
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readImage(Native Method)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:1100)
        at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:915)
        at javax.imageio.ImageIO.read(ImageIO.java:1422)
        at javax.imageio.ImageIO.read(ImageIO.java:1282)
        at ColorConvertTest.doTest(ColorConvertTest.java:271)
        at ColorConvertTest.<init>(ColorConvertTest.java:112)
        at ColorConvertTest.main(ColorConvertTest.java:484)

        When I try to encode the converted image using PNG writer, the colors are completely altered. GIF works fine.

        This is reproducible atleast since 1.5 on all platforms. This is happening regardless of the source color space set in the ColorConvertOp.

        I have attached a sample test. Execute the sample test. Verify the images loaded on the frame. If you get an exception on the console and if the PNG image loaded looks different from the actual image, the bug is reproduced.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                pmohansunw Praveen Mohan (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Imported:
                  Indexed: