From fedb677220d0c335caf4adbfdfdd5d4833ade588 Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 29 Sep 2022 15:48:15 -0400 Subject: [PATCH] add resize options to image processor --- app/services/image.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/services/image.js b/app/services/image.js index 2ad83d5..ea46e51 100644 --- a/app/services/image.js +++ b/app/services/image.js @@ -142,7 +142,14 @@ class ImageService extends SiteService { image.metadata = outputMetadata; try { - let chain = sharpImage.clone().resize({ width: output.width, height: output.height }); + let chain = sharpImage + .clone() + .resize({ + width: output.width, + height: output.height, + options: output.resizeOptions, + }) + ; chain = chain[output.format](output.formatParameters); output.filePath = path.join(imageWorkPath, `${image._id}.${output.width}x${output.height}.${output.format}`);