From 6adb86ec581e7d4cb5d5f7765b992cc7a4b6f59e Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 26 Feb 2002 12:26:43 +0000 Subject: [PATCH] we now produce PNG's instead of JPEGs as they are even freer and support transparency (that was the problem with the GIF's) --- source/mir/misc/WebdbImage.java | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/source/mir/misc/WebdbImage.java b/source/mir/misc/WebdbImage.java index 99ed77f1..62ea7961 100755 --- a/source/mir/misc/WebdbImage.java +++ b/source/mir/misc/WebdbImage.java @@ -86,16 +86,8 @@ public class WebdbImage public byte[] getImage() { if (imageData==null) { ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - - switch (imageType) { - case WEBDB_JPG: - JAI.create("encode", planarImage, outStream, "JPEG", null);break; - case WEBDB_GIF: - JAI.create("encode", planarImage, outStream, "JPEG", null);break; - default: - System.err.println("unknown image format: " + imageType); - } - + // @todo the choice of PNG or JPEG should be made configurable + JAI.create("encode", planarImage, outStream, "PNG", null); imageData = outStream.toByteArray(); } return imageData; @@ -137,15 +129,8 @@ public class WebdbImage InterpolationBilinear interp = new InterpolationBilinear(); PlanarImage temp = JAI.create("scale", planarImage, scale, scale, 0.0F, 0.0F, interp); ByteArrayOutputStream outStream = new ByteArrayOutputStream(); - /** @todo gif */ - switch (imageType) { - case WEBDB_JPG: - JAI.create("encode", temp, outStream, "JPEG", null);break; - case WEBDB_GIF: - JAI.create("encode", temp, outStream, "JPEG", null);break; - default: - System.err.println("unknown image format: " + imageType); - } + // @todo the choice of PNG or JPEG should be made configurable + JAI.create("encode", temp, outStream, "PNG", null); iconData = outStream.toByteArray(); iconWidth=temp.getWidth(); iconHeight=temp.getHeight(); -- 2.11.0