feat: image logging
This commit is contained in:
parent
fb16fb4fee
commit
09af078300
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue