Skip to content

Commit

Permalink
Merge pull request naptha#297 from antonrifco/master
Browse files Browse the repository at this point in the history
support Buffer as Image input of TesseractWorker
  • Loading branch information
jeromewu authored Jul 2, 2019
2 parents 244a480 + 7566d35 commit 42012d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/*
Expand Down

0 comments on commit 42012d6

Please sign in to comment.