From dfc51bd5d0c0f04d4df5752e429e09fdfbf03831 Mon Sep 17 00:00:00 2001 From: "matth@ultra" Date: Mon, 2 Sep 2024 14:32:06 +0200 Subject: [PATCH] handle uppercase extensions --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index f18fa1b..9e94b57 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -const imageExtensions = ['gif','jpg','jpeg','png', 'webp', 'svg', 'pdf']; +const imageExtensions = ['gif','jpg','jpeg','png', 'webp', 'svg', 'ico', 'bmp']; const videoExtensions =['mpg', 'mp2', 'mpeg', 'mpe', 'mpv', 'mp4']; const audioExtensions =['mp3', 'ogg', 'wav', 'flac']; @@ -113,7 +113,7 @@ let currentFile = ""; let currentFileIdx = null; function createMediaFileElement(file, autoplay=false) { - const fileExt = file.split('.').pop(); + const fileExt = file.split('.').pop().toLowerCase(); if (imageExtensions.includes(fileExt)) { // if image let img = document.createElement("img"); img.setAttribute('src', stagingPath + file)