+ in = r.getInputStream();
+ } catch (IOException e) {
+ in = null;
+ if (r instanceof Stream.Ref) {
+ // add extensions to the resource, looking for the image
+ Stream.Ref ref = (Stream.Ref)r;
+ Stream newr;
+
+ String[] exts = new String[] { ".png", ".jpeg", ".gif" };
+ for (int i=0; i < exts.length && in == null; i++) {
+ newr = ref.addExtension(exts[i]);
+ try { in = newr.getInputStream(); }
+ catch (IOException f) { in = null; }
+ }
+ }
+ }
+
+ // could not find image
+ if (in == null) { Log.info(Picture.class, "couldn't load image for resource " + r); return; }
+
+ try {
+ PushbackInputStream pbis = new PushbackInputStream(in);