I am trying to use the Scalr java image resizing library from clojure:
[org.imgscalr/imgscalr-lib "4.2"]
When I import it and try to use it it fails, because of the variable number of args each method takes:
(import 'org.imgscalr.Scalr)
(def image (*acquire BufferedImage instance*))
(Scalr/resize image 200)
This gives me this error:
No matching method: resize
This is because (as I have figured out) resize takes as its last argument a variable number of BufferedImageOps. So, I try to pass in a java array for these:
(import 'java.awt.image.BufferedImageOp)
(Scalr/resize image 200 (into-array BufferedImageOp []))
But this fails with
No message.
[Thrown class java.lang.ClassCastException]
What am I doing wrong here? Thanks!
Possibly you are not acquiring the image as expected.
e.g. This works for me….