From 0cbc8e69a37c25fc3f75991755e82609cc76dde9 Mon Sep 17 00:00:00 2001 From: Zutatensuppe Date: Wed, 21 Apr 2021 10:18:13 +0200 Subject: [PATCH] dont fail on errors, some images fail otherwise --- scripts/resize_images.js | 2 +- server/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/resize_images.js b/scripts/resize_images.js index ee3ad0e..1842cb8 100755 --- a/scripts/resize_images.js +++ b/scripts/resize_images.js @@ -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) { diff --git a/server/index.js b/server/index.js index e035c98..24a5df6 100644 --- a/server/index.js +++ b/server/index.js @@ -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) {