mirror of
https://github.com/penpot/penpot.git
synced 2025-05-13 14:06:37 +02: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.uuid :as uuid]
|
||||||
[uxbox.util.data :as data])
|
[uxbox.util.data :as data])
|
||||||
(:import [java.io Reader PushbackReader]
|
(:import [java.io Reader PushbackReader]
|
||||||
[javax.imageio ImageIO]))
|
[javax.imageio ImageIO]
|
||||||
|
[org.im4java.core Info]))
|
||||||
|
|
||||||
;; --- Constants & Specs
|
;; --- Constants & Specs
|
||||||
|
|
||||||
|
@ -63,11 +64,8 @@
|
||||||
|
|
||||||
(defn- retrieve-image-size
|
(defn- retrieve-image-size
|
||||||
[path]
|
[path]
|
||||||
(let [path (fs/path path)
|
(let [info (Info. (str path) true)]
|
||||||
file (.toFile path)
|
[(.getImageWidth info) (.getImageHeight info)]))
|
||||||
buff (ImageIO/read file)]
|
|
||||||
[(.getWidth buff)
|
|
||||||
(.getHeight buff)]))
|
|
||||||
|
|
||||||
(defn- retrieve-image
|
(defn- retrieve-image
|
||||||
[conn id]
|
[conn id]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue