BMP Reader fails to read USHORT_555_RGB images encoded by BMP Writer with BI_JPEG compression

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P3
    • None
    • Affects Version/s: 6
    • Component/s: client-libs

      I am using USHORT_555_RGB Image which I am writing to a file using BMP Writer with all the supported compression types. When I set the compression type to BI_JPEG, I am getting an exception when reading back the image using BMP reader.

      Here is the exception:
      java.io.EOFException
      at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:330)
      at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:350)
      at com.sun.imageio.plugins.bmp.BMPImageReader.read16Bit(BMPImageReader.java:1234)
      at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:804)
      at javax.imageio.ImageIO.read(ImageIO.java:1400)
      at javax.imageio.ImageIO.read(ImageIO.java:1286)
      at BMPWriterUshort555RGBTest.<init>(BMPWriterUshort555RGBTest.java:135)
      at BMPWriterUshort555RGBTest.main(BMPWriterUshort555RGBTest.java:208)

      This is reproducible on all platforms since Tiger-FCS.

      If this compression type is not supported for the specified image, the protected method canEncodeImage() in BMPWriter must be enhanced to add these conditions also.

      I have attached the sample test and the same image. Run the test as follows:
      'java BMPWriterUshort555RGBTest bmp'. You will see the above exception on the console.
      ###@###.### 2005-07-08 11:33:32 GMT
      ###@###.### 2005-07-08 13:31:03 GMT

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: