From 5bb2a4033aff1a98fc71de8ff8541cd90c91fd11 Mon Sep 17 00:00:00 2001 From: precondition <57645186+precondition@users.noreply.github.com> Date: Tue, 30 Jan 2024 01:04:54 +0100 Subject: [PATCH] Lowercase extension of item before comparing with valid imageTypes --- src/routes/upload/+page.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/upload/+page.svelte b/src/routes/upload/+page.svelte index d17b56b..69d6826 100644 --- a/src/routes/upload/+page.svelte +++ b/src/routes/upload/+page.svelte @@ -41,7 +41,8 @@ max = items.length; for (const item of items) { - if (imageTypes.includes('.' + item.pathname.split('.').at(-1) || '')) { + const itemFileExtension = ('.' + item.pathname.split('.').at(-1)).toLowerCase(); + if (imageTypes.includes(itemFileExtension || '')) { const image = await fetch(url + item.pathname); const blob = await image.blob(); const file = new File([blob], item.pathname.substring(1));