From 09af07830036fcfc605b1bfdf0d8bc0e580d5f58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 7 Dec 2022 17:41:33 +0100 Subject: [PATCH] feat: image logging --- src/components/SVGContent.svelte | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/SVGContent.svelte b/src/components/SVGContent.svelte index cbf98bb..5d2604f 100644 --- a/src/components/SVGContent.svelte +++ b/src/components/SVGContent.svelte @@ -394,8 +394,9 @@ function processImages(document: SVGElement): SVGImageElement[] { const result: SVGImageElement[] = []; Array.from(document.getElementsByTagName("image")).forEach((image) => { - console.debug(`[SVG/IMAGES] Found image #${image.id}.`); - const origPath = image.getAttribute("xlink:href").split("/"); + const href = image.getAttribute("xlink:href"); + console.debug(`[SVG/IMAGES] Found image #${image.id} (${href}).`); + const origPath = href.split("/"); let newHref = `content/images/${origPath[origPath.length - 1]}`; newHref = newHref.replace(/jpg$/, "webp"); image.setAttribute("xlink:href", newHref);