lower case check

This commit is contained in:
Zutatensuppe 2021-04-21 10:15:08 +02:00
parent b6fd0b50ab
commit 6313ad257f
2 changed files with 4 additions and 4 deletions

View file

@ -44,7 +44,7 @@ async function getExifOrientation(imagePath) {
const resizeImage = async (filename) => {
const dir = `./../data/uploads/`
if (!filename.match(/\.(jpe?g|webp|png)$/)) {
if (!filename.toLowerCase().match(/\.(jpe?g|webp|png)$/)) {
return
}
console.log(filename)
@ -74,7 +74,7 @@ const resizeImage = async (filename) => {
const allImages = () => {
const images = fs.readdirSync('./../data/uploads/')
.filter(f => f.match(/\.(jpe?g|webp|png)$/))
.filter(f => f.toLowerCase().match(/\.(jpe?g|webp|png)$/))
.map(f => ({
file: `./../data/uploads/${f}`,
url: `/uploads/${f}`,