Fix incorrect path handling

This commit is contained in:
Lucas Sköld
2025-09-16 14:06:09 +02:00
parent 2a6b313452
commit ca74e4ee7e
+4 -1
View File
@@ -714,10 +714,13 @@ async function addPreviewImage(entry, path, settings) {
);
}
const normalizedPath = path.replace(/\\/g, "/");
const imageName = normalizedPath.split("/").pop().split(".")[0];
// Create and position the actual preview image
const preview = document.createElement("img");
preview.className = "preview-image";
preview.src = `${API_PREFIX}/images/${path.split("/").pop().split(".")[0]}`;
preview.src = `${API_PREFIX}/images/${imageName}`;
preview.style.maxWidth = `${maxSize}px`;
preview.style.maxHeight = `${maxSize}px`;
preview.style.position = "fixed";