2003/11/16 02:40:43
[org.ibex.core.git] / src / org / xwt / Picture.java
index 942bf03..3168390 100644 (file)
@@ -30,7 +30,7 @@ public abstract class Picture {
     public abstract int getWidth();
 
     /** Pictures, cache keyed by Res instance */
-    private static Cache cache = new Cache();
+    private static Cache cache = new Cache(100);
     private static GIF gif = new GIF();
     
     /** turns a resource into a Picture.Source and passes it to the callback */
@@ -45,9 +45,9 @@ public abstract class Picture {
                         try {
                             Picture ret = null;
                             InputStream pbis = new ByteArrayInputStream(b);
-                            if ((b[0] & 0xff) == 'G') ret = gif.fromInputStream(pbis, r.getDescriptiveName());
-                            else if ((b[0] & 0xff) == 137) ret = new PNG().fromInputStream(pbis, r.getDescriptiveName());
-                            else if ((b[0] & 0xff) == 0xff) ret = Platform.decodeJPEG(pbis, r.getDescriptiveName());
+                            if ((b[0] & 0xff) == 'G') ret = gif.fromInputStream(pbis, "some picture");
+                            else if ((b[0] & 0xff) == 137) ret = new PNG().fromInputStream(pbis, "some picture");
+                            else if ((b[0] & 0xff) == 0xff) ret = Platform.decodeJPEG(pbis, "some picture");
                             else throw new JS.Exn("couldn't figure out image type from first byte");
                             ret.res = r;
                             cache.put(r, ret);