diff --git a/backend/src/app/rpc/commands/binfile.clj b/backend/src/app/rpc/commands/binfile.clj index 72cb419c9..632239f2b 100644 --- a/backend/src/app/rpc/commands/binfile.clj +++ b/backend/src/app/rpc/commands/binfile.clj @@ -516,6 +516,9 @@ :media (count media) ::l/sync? true) + (doseq [item media] + (l/debug :hint "write penpot file media object" :id (:id item) ::l/sync? true)) + (doto output (write-obj! file) (write-obj! media)) @@ -770,7 +773,7 @@ (defn- lookup-index [id] (let [val (get-in @*state* [:index id])] - (l/trace :fn "lookup-index" :id id :val val ::l/sync? true) + (l/debug :fn "lookup-index" :id id :val val ::l/sync? true) (when (and (not (::ignore-index-errors? *options*)) (not val)) (ex/raise :type :validation :code :incomplete-index @@ -783,7 +786,7 @@ index index] (if-let [id (first items)] (let [new-id (if (::overwrite? *options*) id (uuid/next))] - (l/trace :fn "update-index" :id id :new-id new-id ::l/sync? true) + (l/debug :fn "update-index" :id id :new-id new-id ::l/sync? true) (recur (rest items) (assoc index id new-id))) index))) @@ -801,8 +804,7 @@ (update-in [:metadata :id] lookup-index) ;; Relink paths with fill image - (and (map? (:fill-image form)) - (= :path (:type form))) + (map? (:fill-image form)) (update-in [:fill-image :id] lookup-index) ;; This covers old shapes and the new :fills. diff --git a/backend/src/app/tasks/file_gc.clj b/backend/src/app/tasks/file_gc.clj index 9b9c2134a..ac83404a1 100644 --- a/backend/src/app/tasks/file_gc.clj +++ b/backend/src/app/tasks/file_gc.clj @@ -113,8 +113,15 @@ (mapcat vals) (keep (fn [{:keys [type] :as obj}] (case type - :path (get-in obj [:fill-image :id]) + :path (get-in obj [:fill-image :id]) + :bool (get-in obj [:fill-image :id]) + ;; NOTE: because of some bug, we ended with + ;; many shape types having the ability to + ;; have fill-image attribute (which initially + ;; designed for :path shapes). + :group (get-in obj [:fill-image :id]) :image (get-in obj [:metadata :id]) + nil)))) pages (concat (vals (:pages-index data)) diff --git a/frontend/src/app/thumbnail_renderer.cljs b/frontend/src/app/thumbnail_renderer.cljs index d48780edf..f60b3d3ec 100644 --- a/frontend/src/app/thumbnail_renderer.cljs +++ b/frontend/src/app/thumbnail_renderer.cljs @@ -97,11 +97,12 @@ (defn- svg-update-image! "Updates an image in an SVG to a Data URI." [image] - (when-let [href (dom/get-attribute image "href")] + (if-let [href (dom/get-attribute image "href")] (->> (fetch-as-data-uri href) (rx/map (fn [url] (dom/set-attribute! image "href" url) - image))))) + image))) + (rx/empty))) (defn- svg-resolve-images! "Resolves all images in an SVG to Data URIs."