we now produce PNG's instead of JPEGs as they are even freer and support
authormh <mh>
Tue, 26 Feb 2002 12:26:43 +0000 (12:26 +0000)
committermh <mh>
Tue, 26 Feb 2002 12:26:43 +0000 (12:26 +0000)
transparency (that was the problem with the GIF's)

source/mir/misc/WebdbImage.java

index 99ed77f..62ea796 100755 (executable)
@@ -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();