Skip to content

Instantly share code, notes, and snippets.

@RobinRamael
Created August 9, 2011 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobinRamael/1133895 to your computer and use it in GitHub Desktop.
Save RobinRamael/1133895 to your computer and use it in GitHub Desktop.
Loading buffered images lazily gives OutOfMemoryException
(defn load-image [file]
(javax.imageio.ImageIO/read file))
(defn imgs-from-files [files]
(if (not (empty? files))
(lazy-seq
(cons (load-image
(first files))
(imgs-from-files (rest files))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment