feat: image logging

version/enerpe
Tomáš Mládek 2022-12-07 17:41:33 +01:00
parent fb16fb4fee
commit 09af078300
1 changed files with 3 additions and 2 deletions

View File

@ -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);