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

BMP Writer fails when writing TYPE_USHORT_565_RGB with BI_BITFIELDS and sub-sampling

XMLWordPrintable

    • b10
    • generic
    • generic
    • Verified

      I am running the attached test which writes a TYPE_USHORT_565_RGB buffered image using BMP Writer with all supported compression types. This test fails to read the image back from the file using ImageIO when image is encoded with BITFIELDS compression. An exception is thrown.

      Here is the exception -

      java.io.EOFException
      at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:339)
      at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:359)
      at com.sun.imageio.plugins.bmp.BMPImageReader.read16Bit(BMPImageReader.java:1230)
      at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:821)
      at javax.imageio.ImageIO.read(ImageIO.java:1422)
      at javax.imageio.ImageIO.read(ImageIO.java:1282)
      at BMPWriterUshort555RGBTest.<init>(BMPWriterUshort555RGBTest.java:148)
      at BMPWriterUshort555RGBTest.main(BMPWriterUshort555RGBTest.java:222)

      Also the output image created by BMP writer has got 2 black lines which is not there in the original image, running diagonally.

      This is reproducible on all platforms atleast since 1.5.

      I have attached the source image, output image and the sample test.

            bae Andrew Brygin
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: