我试图在 clojure 中找到加载图像的宽度。在处理过程中,我会这样做,
PImage img=loadImage("image.jpg");
int x=img.width;
int y=img.height;
我试图在clojure中做同样的事情,但它不起作用
(defn loadwebimg []
(let [filelst (map (fn [f] (.getName f)) (.listFiles (File. (str datadir))))
imgf (first (shuffle filelst))
webimg (load-image (str datadir imgf))
]
(image webimg 0 0)
(println webimg.height))