From df759574184bb7a8172bc69031a9e346c4a6c7a7 Mon Sep 17 00:00:00 2001 From: Maksym Shekhovets Date: Mon, 20 Dec 2021 12:03:18 +0200 Subject: [PATCH] fix of import issue See https://github.com/y-a-v-a/node-gd/issues/84 --- lib/node-gd.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/node-gd.js b/lib/node-gd.js index 9b82b5b..ea29dd2 100644 --- a/lib/node-gd.js +++ b/lib/node-gd.js @@ -85,9 +85,11 @@ formats.forEach(format => { return; } - Object.defineProperty(bindings.Image.prototype, `save${format}`, { - value: saveFormatFn(format) - }); + if (!bindings.Image.prototype[`save${format}`]) { + Object.defineProperty(bindings.Image.prototype, `save${format}`, { + value: saveFormatFn(format) + }); + } }); /**