Merge pull request #11 from precondition/patch-1

Lowercase extension of item before comparing with accepted imageTypes
This commit is contained in:
Shaun Tenner
2024-01-30 10:09:47 +02:00
committed by GitHub

View File

@@ -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));