From 4ffbead8dbb9149ed66f264326b5b0d13a66a0b3 Mon Sep 17 00:00:00 2001 From: TangentSquared Date: Sat, 18 Mar 2023 13:40:34 +0530 Subject: [PATCH] Update save-pixels.js 'new Buffer(size)' is deprecated. Changed the same to 'Buffer.alloc(size)' --- save-pixels.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/save-pixels.js b/save-pixels.js index 9efce4d..d9723d4 100644 --- a/save-pixels.js +++ b/save-pixels.js @@ -87,7 +87,7 @@ module.exports = function savePixels (array, type, options) { case '.JPE': var width = array.shape[0] var height = array.shape[1] - var data = new Buffer(width * height * 4) + var data = Buffer.alloc(width * height * 4) data = handleData(array, data) var rawImageData = { data: data,