dont fail on errors, some images fail otherwise

This commit is contained in:
Zutatensuppe 2021-04-21 10:18:13 +02:00
parent 6313ad257f
commit 0cbc8e69a3
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ images.forEach(async (image) => {
const iamgeOutPath = `${dir}/r/${image}`
const orientation = await getExifOrientation(imagePath)
let sharpImg = sharp(imagePath)
let sharpImg = sharp(imagePath, { failOnError: false })
// when image is rotated to the left or right, switch width/height
// https://jdhao.github.io/2019/07/31/image_rotation_exif_info/
if (orientation === 6) {

View file

@ -53,7 +53,7 @@ const resizeImage = async (filename) => {
const iamgeOutPath = `${dir}/r/${filename}`
const orientation = await getExifOrientation(imagePath)
let sharpImg = sharp(imagePath)
let sharpImg = sharp(imagePath, { failOnError: false })
// when image is rotated to the left or right, switch width/height
// https://jdhao.github.io/2019/07/31/image_rotation_exif_info/
if (orientation === 6) {