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: 4908419
Votes 3
Synopsis Loading transparent GIF and storing as JPEG results in a corrupt image.
Category jai:implementation
Reported Against 1.1.1
Release Fixed 1.1.3-alpha
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs
Submit Date 18-AUG-2003
Description




FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)


FULL OS VERSION :
 customer  Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
The following code results in a corrupt JPEG image if the source GIF image contains transparency information:


ParameterBlockJAI pb = new ParameterBlockJAI("fileload");
pb.set("myTransparent.gif", 0);
planarImage img = JAI.create("fileload", pb);

pb = new ParameterBlockJAI("filestore");
pb.addSource(img);
pb.setParameter("filename", "myOutputImage.jpeg");
pb.setParameter("format", "JPEG");
JAI.create("filestore", pb);


Storing as PNG does not result in a corrupt image.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the code in the bug description. Load the output JPEG in an image viewer or web browser.


EXPECTED VERSUS ACTUAL BEHAVIOR :
The output file should be in a valid JPEG format. If proper conversion is impossible, an exception should be thrown.

The output file is not in a valid format. There is no exception thrown.


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
ParameterBlockJAI pb = new ParameterBlockJAI("fileload");
pb.set("myTransparent.gif", 0);
planarImage img = JAI.create("fileload", pb);

pb = new ParameterBlockJAI("filestore");
pb.addSource(img);
pb.setParameter("filename", "myOutputImage.jpeg");
pb.setParameter("format", "JPEG");
JAI.create("filestore", pb);

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Save as PNG instead.
(Incident Review ID: 183907) 
======================================================================
Work Around
N/A
Evaluation
Need to check whether result of icm.convertToIntDiscrete() is 3- or 4-banded and if 4-banded convert to 3-banded.
  xxxxx@xxxxx   2005-05-10 00:58:13 GMT
Comments
  
  Include a link with my name & email   

Submitted On 28-MAY-2004
virtualdrummer
This appears to be the same bug that is found when using ImageIO operations to perform the translation of a JPEG to a GIF.



PLEASE NOTE: JDK6 is formerly known as Project Mustang