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 */
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);