} catch (FileNotFoundException fnf) { return null;
}  if (in == null) { String msg = "Unrecognized argument in Image.getInfo(): "; msg += arg == null ? "null" : arg.getClass().toString(); throw new IllegalArgumentException(msg); }  info.setInput(in); if (info.check()) { ret = Context.toObject(info, scope); }  } catch (IOException e) {  } finally { if (in != null) { try { in.close(); } catch (IOException ee) { }
        public Object call(Context cx, Scriptable scope,                           Scriptable thisObj, Object[] args) {            if (args.length != 1) {                throw new IllegalArgumentException("Image.getInfo() expects one argument");            }            Object arg = args[0];            InputStream in = null;            ImageInfo info = new ImageInfo();            if (arg instanceof Wrapper) {                arg = ((Wrapper) arg).unwrap();            }            if (arg instanceof InputStream) {                in = (InputStream) arg;            } else if (arg instanceof byte[]) {                in = new ByteArrayInputStream((byte[]) arg);            } else if (arg instanceof File) {                try {                    in = new FileInputStream((File) arg);                } catch (FileNotFoundException fnf) {                    return null;                }            } else if (arg instanceof File) {                try {                    in = new FileInputStream((File) arg);                } catch (FileNotFoundException fnf) {                    return null;                }            } else if (arg instanceof FileObject) {                try {                    in = new FileInputStream(((FileObject)arg).getFile());                } catch (FileNotFoundException fnf) {                    return null;                }            } else if (arg instanceof String) {                String str = (String) arg;                // try to interpret argument as URL if it contains a colon,                // otherwise or if URL is malformed interpret as file name.                try {                    if (str.indexOf(":") > -1) {                        try {                            URL url = new URL(str);                            in = url.openStream();                        } catch (MalformedURLException mux) {                            in = new FileInputStream(str);                        } catch (IOException iox) {                            return null;                        }                    } else {                        in = new FileInputStream((String) arg);                    }                } catch (FileNotFoundException fnf) {                    return null;                }            }            if (in == null) {                String msg = "Unrecognized argument in Image.getInfo(): ";                msg += arg == null ? "null" : arg.getClass().toString();                throw new IllegalArgumentException(msg);            }            info.setInput(in);            if (info.check()) {                return Context.toObject(info, scope);            }            return null;        }