From 7566d3550fec9619170a0dfb8402fbc32b0333cf Mon Sep 17 00:00:00 2001 From: antonrifco Date: Thu, 13 Jun 2019 19:41:27 +0700 Subject: [PATCH] support buffer in Image of TesseractWorker support buffer in Image of TesseractWorker --- src/node/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node/index.js b/src/node/index.js index f05dbc4..575c18d 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -34,7 +34,8 @@ const loadImage = (image) => { }) .then(resp => resp.data); } - return readFile(image); + if (Buffer.isBuffer( image) ) return new Promise(function(resolve, reject) { resolve(image); }); + else return readFile(image); }; /*