From 747e452208d25d603e8fb0a0921375abb8ff3425 Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 22 Sep 2020 16:08:11 +0200 Subject: [PATCH 1/2] Update index.js We are only downloading the base image if the `options` param explicitly includes the option `{prepareBaseImage: false}`. Otherwise, it will omit downloading the base file, even if the helper configuration includes the prepareBaseImage option. This change allows us to default to the value in the config file if the method doesn't receive that param. --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 99645fa..62e227c 100644 --- a/index.js +++ b/index.js @@ -312,8 +312,11 @@ class ResembleHelper extends Helper { options.prepareBaseImage = true; } + const prepareBaseImage = options.prepareBaseImage !== undefined + ? options.prepareBaseImage + : this.config.prepareBaseImage const awsC = this.config.aws; - if (awsC !== undefined && options.prepareBaseImage === false) { + if (awsC !== undefined && prepareBaseImage === false) { await this._download(awsC.accessKeyId, awsC.secretAccessKey, awsC.region, awsC.bucketName, baseImage); } if (options.prepareBaseImage !== undefined && options.prepareBaseImage) { From 69cd7bf8d1786c37b2679ab3be8bb1efe09ff69b Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 22 Sep 2020 16:57:28 +0200 Subject: [PATCH 2/2] Update index.js --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index 62e227c..107632e 100644 --- a/index.js +++ b/index.js @@ -308,13 +308,9 @@ class ResembleHelper extends Helper { options.tolerance = 0; } - if (this.prepareBaseImage) { - options.prepareBaseImage = true; - } - const prepareBaseImage = options.prepareBaseImage !== undefined ? options.prepareBaseImage - : this.config.prepareBaseImage + : (this.prepareBaseImage === true) const awsC = this.config.aws; if (awsC !== undefined && prepareBaseImage === false) { await this._download(awsC.accessKeyId, awsC.secretAccessKey, awsC.region, awsC.bucketName, baseImage);