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:
parent
0192298d09
commit
e73339d2f9
1 changed files with 4 additions and 6 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue