Lowercase extension of item before comparing with valid imageTypes
This commit is contained in:
@@ -41,7 +41,8 @@
|
|||||||
max = items.length;
|
max = items.length;
|
||||||
|
|
||||||
for (const item of items) {
|
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 image = await fetch(url + item.pathname);
|
||||||
const blob = await image.blob();
|
const blob = await image.blob();
|
||||||
const file = new File([blob], item.pathname.substring(1));
|
const file = new File([blob], item.pathname.substring(1));
|
||||||
|
|||||||
Reference in New Issue
Block a user