mirror of
https://github.com/penpot/penpot.git
synced 2025-05-28 12:46:12 +02:00
✨ Strip extension for uploaded image files
This commit is contained in:
parent
c3c667d4b5
commit
2190616957
3 changed files with 32 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
|||
(:require
|
||||
[app.common.data.macros :as dm]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.files.builder :as fb]
|
||||
[app.common.logging :as log]
|
||||
[app.common.math :as mth]
|
||||
[app.common.pages.changes-builder :as pcb]
|
||||
|
@ -134,7 +135,7 @@
|
|||
(= (.-type blob) "image/svg+xml")))
|
||||
|
||||
(prepare-blob [blob]
|
||||
(let [name (or name (if (dmm/file? blob) (.-name blob) "blob"))]
|
||||
(let [name (or name (if (dmm/file? blob) (fb/strip-image-extension (.-name blob)) "blob"))]
|
||||
{:file-id file-id
|
||||
:name name
|
||||
:is-local local?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue