Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6549882
Votes 0
Synopsis PNG reader should load RGB[A] images in display-optimal format
Category java:imageio
Reported Against
Release Fixed 7(b20), 6u18(b03) (Bug ID:2183443)
State 10-Fix Delivered, bug
Priority: 3-Medium
Related Bugs 6879279
Submit Date 24-APR-2007
Description
PNG reader should load RGB[A] images in display-optimal format as do the JPEG and BMP readers.
Posted Date : 2007-04-24 22:42:41.0
Work Around
Copy the loaded image into a non-TYPE_CUSTOM image thereby doubling the memory.
Evaluation
The idea of this fix is to force png reader to create buffered image of
some standard type for pngs of color type RGB or RGBAlpha and bit depth
8.

I suggest to add appropriate standard image types to the list of image
types constructed by the reader. Namely:

 * for RGB color type we add TYPE_3BYTE_BGR, TYPE_INT_RGB and
    TYPE_INT_BGR.
 * for RGBAlpha color type we add TYPE_4BYTE_ABGR and TYPE_INT_RGB.

Also we need to override getRawImageType() method to keep custom
image type as a raw one. 

Note that destination types based on InteherInterleaveRaster (TYPE_INT_RGB, TYPE_INT_BGR, TYPE_INT_ARGB) may cause performance
degradation.  It is because ByteInterleavedRaster provides optimized
setRect() routine if argument is raster of same type. However IntegerInterleasvedRaster does not provide optimized setRect()
implementation and uses generic one inherited from WritableRaster class.

It seems to me that we get some improvements if we will use
getPixel()/setPixel() approach instead of setRect() for raster differ
form ByteInterleavedRaster.
Posted Date : 2007-08-01 03:10:22.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang