|
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)
======================================================================
|