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

Output BMP image is distorted when writing TYPE_3BYTE_BGR buff image with BI_BITFIELDS compression

    XMLWordPrintable

Details

    • b56
    • generic
    • generic
    • Verified

    Description

      I am writing a buffered image of type TYPE_3BYTE_BGR to a file using a BMP Writer. I am setting the compression type to BI_BITFIELDS in the image write param and using this param to write the image. The output image generated is completely distorted and unusable. None of the native image applications recognize this as a valid bmp image.

      The canEncodeImage() protected method in BMPWriter does not enforce any rectrictions in using this compression type with the given image, neither it throws an IOException saying this image type is not compatible with the specified compression.

      This is reproducible on all platforms since Tiger-FCS.

      I have attached a sample test which reproduces the bug. The 3rd image loaded onto a frame would be corrupted.
      ###@###.### 2005-07-14 17:35:09 GMT

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: