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) {