You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ran into this issue where a file system glob pulled in an invalid file that didn't contain an image. At present, if you try to load an invalid image file you get an NPE, for example with a fairly minimal repro (copying README.md to resource in a vanilla Leiningen project):
It seems like this case could be caught and handled with a more idiomatic Exception? I could take a stab at it given agreement and consensus around what the Exception should be.
The text was updated successfully, but these errors were encountered:
I'm seeing the same thing, by a slightly more convoluted route, since upgrading to 0.11.0
I had been using fivetonine.collage.util to actually load the images, but that loads a java.awt.image.BufferedImage which imagez 0.11.0 doesn't like, so I attempted a change to load-image-resource:
And this results in an illegal argument exception which is caused by a null pointer:
ERROR in (apply-heightmap-test) (core_deftype.clj:568)
Uncaught exception, not in assertion.
expected: nil
actual: java.lang.IllegalArgumentException: No implementation of method: :as-image of protocol: #'mikera.image.protocols/ImageResource found for class: nil
at clojure.core$_cache_protocol_fn.invokeStatic (core_deftype.clj:568)
clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:560)
mikera.image.protocols$eval1366$fn__1367$G__1357__1372.invoke (protocols.clj:15)
Actually I think this may be a different but related exception, in that it's possible that the file path that worked with collage isn't working with imagez so may not actually find a file at all, as the file I'm expecting it to find is a perfectly good PNG.
Ran into this issue where a file system glob pulled in an invalid file that didn't contain an image. At present, if you try to load an invalid image file you get an NPE, for example with a fairly minimal repro (copying README.md to resource in a vanilla Leiningen project):
produces:
It seems like this case could be caught and handled with a more idiomatic Exception? I could take a stab at it given agreement and consensus around what the Exception should be.
The text was updated successfully, but these errors were encountered: