United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6296893 BMP Writer handles TopDown property incorrectly for some of the compression types
JDK-6296893 : BMP Writer handles TopDown property incorrectly for some of the compression types

Details
Type:
Bug
Submit Date:
2005-07-14
Status:
Resolved
Updated Date:
2012-10-01
Project Name:
JDK
Resolved Date:
2009-06-30
Component:
client-libs
OS:
windows_vista,solaris_11,linux,generic,windows_7
Sub-Component:
javax.imageio
CPU:
x86,arm,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
e6u10,5.0,6u21,6u30,6u31,6u32
Fixed Versions:

Related Reports
Duplicate:
Duplicate:
Duplicate:

Sub Tasks

Description
I am setting the TopDown property to true in BMPWriteParam by calling setTopDown(true). I am getting all the supported compression types and looping through them one by one and setting it to the write param. I am writing the image using each of these compression types, with topdown true using BMPImageWriter. 

I noticed that the image is actually inverted for some of the compression types such BI_RGB and BI_BITFIELDS whereas it is normal for other compression types such as BI_JPG and BI_PNG. The spec does not say anything about the dependency of TopDown on compression. I feel the behavior of TopDown must be same regardless of what compression types are used. 

This is reproducible on all platforms right from Tiger-FCS.

I have attached a sample test that would demonstrate this bug.
###@###.### 2005-07-14 14:20:11 GMT

                                    

Comments
EVALUATION

The reason of problem is that  bmp image writer does not take the isTopDown flag into account during info header writing. The height of image must be negative if isTopDown flag is true, but bmp writer always write positive image height.
However, according to MSDN description, the top-down image layout is allowed only if compression type is BI_RGB or BI_BITFIELDS. Images with any other compression type must be wrote in the bottom-up layout.
                                     
2005-10-02
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/java2d_data/7/6296893
                                     
2009-06-11



Hardware and Software, Engineered to Work Together