FULL PRODUCT VERSION :
java version "1.4.2_10"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_10-b03)
Java HotSpot(TM) Client VM (build 1.4.2_10-b03, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows XP Version 2002 Service Pack 2
A DESCRIPTION OF THE PROBLEM :
Saving some small gif files as a jpeg produces a corrupt file.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
save http://www.nabble.com/images/icon_alert_sm.gif as t.gif
run the code I supplied to convert this to t.jpeg
try loading t.jpeg into a browser
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expect a usable jpeg.
ACTUAL -
Browser complains that t.jpeg has errors.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.*;
import java.awt.image.*;
import javax.imageio.*;
public class Gif {
public static void main(String[] args) throws Exception {
BufferedImage bi = ImageIO.read(new File("t.gif"));
ImageIO.write(bi, "jpeg", new File("t.jpeg"));
}
}
---------- END SOURCE ----------