1.导入jimi.jar
2.将gif图片转换成jpg格式
public static void toJPG() {
try {
String source = "d:/1.gif";
String dest = source.substring(0, source.lastIndexOf(".")) + ".jpg";
System.out.println(dest);
JPGOptions options = new JPGOptions();
options.setQuality(72);
ImageProducer image = Jimi.getImageProducer(source);
JimiWriter writer = Jimi.createJimiWriter(dest);
writer.setSource(image);
writer.setOptions(options);
writer.putImage(dest);
} catch (JimiException je) {
System.err.println("Error: " + je);
}
}