0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-10 14:51:37 -05:00

Add faster implementation for retrieve image size.

This commit is contained in:
Andrey Antukh 2016-11-20 21:19:53 +01:00
parent 0192298d09
commit e73339d2f9
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -24,7 +24,8 @@
[uxbox.util.uuid :as uuid]
[uxbox.util.data :as data])
(:import [java.io Reader PushbackReader]
[javax.imageio ImageIO]))
[javax.imageio ImageIO]
[org.im4java.core Info]))
;; --- Constants & Specs
@ -63,11 +64,8 @@
(defn- retrieve-image-size
[path]
(let [path (fs/path path)
file (.toFile path)
buff (ImageIO/read file)]
[(.getWidth buff)
(.getHeight buff)]))
(let [info (Info. (str path) true)]
[(.getImageWidth info) (.getImageHeight info)]))
(defn- retrieve-image
[conn id]