From 24665dc8321e5f5ae1782272c3c8bf4b06d42bda Mon Sep 17 00:00:00 2001 From: Tobias Ask Date: Tue, 27 Aug 2019 16:31:06 +0200 Subject: [PATCH] Convert width setting value to number Convert the type of the variable containing the application's THUMBNAIL_WIDTH setting value from a string to a number since Jimp.resize takes numbers as its parameters. This fixes a bug that crashes the function. --- Thumbnail/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Thumbnail/index.js b/Thumbnail/index.js index f1a1256..c68a524 100644 --- a/Thumbnail/index.js +++ b/Thumbnail/index.js @@ -6,7 +6,7 @@ const blobService = storage.createBlobService(); module.exports = (context, myEvent, myBlob) => { - const widthInPixels = process.env.THUMBNAIL_WIDTH; + const widthInPixels = Number(process.env.THUMBNAIL_WIDTH); const blobName = myEvent.subject.split('/')[6]; Jimp.read(myBlob).then((thumbnail) => {