United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6399660 PIT: Using subsampling with compression alters the colors for some of the image types for BMP
JDK-6399660 : PIT: Using subsampling with compression alters the colors for some of the image types for BMP

Details
Type:
Bug
Submit Date:
2006-03-16
Status:
Closed
Updated Date:
2011-01-19
Project Name:
JDK
Resolved Date:
2006-04-19
Component:
client-libs
OS:
generic
Sub-Component:
javax.imageio
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
5.0,6
Fixed Versions:

Related Reports
Duplicate:
Relates:

Sub Tasks

Description
I am setting a sub-sampling value in the ImageWriteParam and trying to write each of the buffered image types using BMP Writer, using all the supported compression types. But in the PIT build for Mustang-b77, I am noticing the following behaviors:

1. Writing TYPE_INT_RGB using BI_BITFIELDS compression alters the image colors when subsampling is specified.

2. TYPE_INT_BGR did not work fine before because of the bug 6299168 but it works fine on the current PIT build

3. Writing TYPE_3BYTE_BGR using BI_RGB, BI_BITFIELDS compression types with subsampling set makes the image appear bluish.

4. Writing TYPE_USHORT_565_RGB with BI_BITFIELDS compression and subsampling makes the output image appear in different color.

5. Writing TYPE_USHORT_555_RGB using BI_RGB, BI_BITFIELDS compression types alters the image colors and BI_BIFIELDS image is slightly corrupted.

All the above behaviors are noticed only on the PIT build and not reproducible on Mustang-b75 or earlier. All the above issues are reproducible on Win32 as well as Solaris. All the issues are hence regressions introduced in the b77 PIT build.

I have attached a sample test with the necessary images. Run the test on the PIT build. You would see a frame with a choice. Click on the items in the choice one by one to test each of those buffered image types. You will notice that the image colors are altered for the above cases.

                                    

Comments
EVALUATION

The fix for 5076878 shifts problem with writing subsampled images from
case of BI_RGB compression to case BI_BITFIELDS compression.

To solve this problem we should separate these two cases:

 - for BI_RGB compression  the BGR order of raster data should be used
     (except the case of 16bpp images where RGB data order is defined by
      the BMP spec)

 - for BI_BITFIELDS compression order of raster data should be defined
     using corresponding masks. In case of default bitfields masks the 
     RGB order of raster data is used.
                                     
2006-03-17



Hardware and Software, Engineered to Work Together