From a187afd6c7f0bdc1245827958e5ffae245c7397b Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Tue, 29 Oct 2024 05:37:24 -0700 Subject: [PATCH] Don't use thumbnails for SVG files --- root/view.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/root/view.php b/root/view.php index b351ab8..32ae9e7 100644 --- a/root/view.php +++ b/root/view.php @@ -465,6 +465,8 @@ var ds; if (full_size) { ds = 'albums/' + ie.getAttribute('data-src'); + } else if (sidebar.children[image].getAttribute('data-type').startsWith('image/svg')) { + ds = 'albums/' + ie.getAttribute('data-src'); } else { ds = 'thumbnails/large/' + ie.getAttribute('data-src'); } @@ -500,8 +502,12 @@ if (me.getAttribute('data-audiotype') !== null) { // Audio does not require work } else if (me instanceof HTMLImageElement) { - // Image - me.src = 'thumbnails/small/' + me.getAttribute('data-src'); + // Image, SVG files don't have thumbnails + if (elem.getAttribute('data-type').startsWith('image/svg')) { + me.src = 'albums/' + me.getAttribute('data-src'); + } else { + me.src = 'thumbnails/small/' + me.getAttribute('data-src'); + } } me.style.display = "initial"; }