mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 09:56:11 +02:00
✨ Add svg optimization on components migration process
This commit is contained in:
parent
f92c6e5db4
commit
00afb841ac
8 changed files with 125 additions and 64 deletions
|
@ -45,8 +45,6 @@
|
|||
[datoteka.io :as io]
|
||||
[promesa.exec.semaphore :as ps]))
|
||||
|
||||
;; - What about use of svgo on converting graphics to components
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; END PROMESA HELPERS
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -443,10 +441,15 @@
|
|||
|
||||
(defn- create-shapes-for-svg
|
||||
[{:keys [id] :as mobj} file-id objects position]
|
||||
(let [svg-text (get-svg-content id)
|
||||
svg-data (-> (csvg/parse svg-text)
|
||||
(assoc :name (:name mobj))
|
||||
(collect-and-persist-images file-id))]
|
||||
(let [svg-text (get-svg-content id)
|
||||
|
||||
optimizer (::csvg/optimizer *system*)
|
||||
svg-text (csvg/optimize optimizer svg-text)
|
||||
|
||||
svg-data (-> (csvg/parse svg-text)
|
||||
(assoc :name (:name mobj))
|
||||
(collect-and-persist-images file-id))]
|
||||
|
||||
(sbuilder/create-svg-shapes svg-data position objects uuid/zero nil #{} false)))
|
||||
|
||||
(defn- process-media-object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue