JDK-6444688 : Printing IndexColorModel images with a transparent pixel may fail on windows
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2006-06-28
  • Updated: 2010-04-02
  • Resolved: 2006-07-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b92Fixed
Related Reports
Relates :  
Description
Printing an image with bitmask transparency is sometimes incorrect on windows.

This was introduced in b77 when fixing :
4521945: Java 2D: RFE: improve efficiency of printing for indexed colour images

Prior to this fix a new temporary BufferedImage would always be created
which included (eg) any transformation that needed to be applied to the image
This was so the data storage for a simple rectangular area could be passed
down to native code so that it could be used (when reversed and padded) as
the data for a GDI DIB with minimal knowledge of the data storage layout.

Part of the 4521945 fix involved adding conditions under which it is
OK to directly pass a reference to the original BufferedImage's data
storage down to the native printing code instead of making a copy.

A problem exists with the bitmask transparency case as printing code
handles this as multiple smaller subimages of the original image. The
native code was however always assuming a zero offset into the data buffer.
This code needs to be able to properly navigate the Raster.

For now the simplest and least risky fix is to revert to always creating a copy.
The code that avoided the copy was rudimentary in any case, and will be revisited
at a later date. Also the scenario in which this was discovered did not actually
use the transparency. The code that detects whether we need to handle transparency
always handed off a bitmask transparent image to be printed via the mechanism which
prints as subimages without checking if in fact the transparent pixel is used in
the source image. And even when needed the code could also look to be more efficient
in using the largest possible subimage rather than a line at a time.
Resolving that is also for a later time.

Comments
EVALUATION As per description.
28-06-2006