From 4b02704c1de4959a644a20bc72e7be592c7c4f37 Mon Sep 17 00:00:00 2001 From: Bart Van Remortele Date: Tue, 28 Feb 2017 10:14:06 +0100 Subject: [PATCH 1/3] fix(psm-mode): fix psm command change for tesseract 3.05.00 https://github.com/tesseract-ocr/tesseract/releases/tag/3.05.00 --- lib/tesseract.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tesseract.js b/lib/tesseract.js index 2f7e13c..3aec206 100644 --- a/lib/tesseract.js +++ b/lib/tesseract.js @@ -63,7 +63,7 @@ var Tesseract = { } if (options.psm !== null) { - command.push('-psm ' + options.psm); + command.push('--psm ' + options.psm); } if (options.config !== null) { From 4d1fe58be35d66a343e4e14b6d1cca8d6ca2e434 Mon Sep 17 00:00:00 2001 From: Bart Van Remortele Date: Tue, 28 Feb 2017 14:03:40 +0100 Subject: [PATCH 2/3] feat(debug): add debug option to output commands --- lib/tesseract.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/tesseract.js b/lib/tesseract.js index 3aec206..290a472 100644 --- a/lib/tesseract.js +++ b/lib/tesseract.js @@ -23,7 +23,8 @@ var Tesseract = { 'l': 'eng', 'psm': 3, 'config': null, - 'binary': 'tesseract' + 'binary': 'tesseract', + 'debug': false }, /** @@ -74,6 +75,12 @@ var Tesseract = { var opts = options.env || {}; + if(options.debug) { + console.log(`command: ${command}`); + console.log(`opts: ${opts}`); + console.log(`output: ${output}`); + } + // Run the tesseract command exec(command, opts, function(err) { if (err) { From affac36e1430e1581b5f51d0a55fa5757f264b91 Mon Sep 17 00:00:00 2001 From: Bart Van Remortele Date: Tue, 28 Feb 2017 14:03:57 +0100 Subject: [PATCH 3/3] chore(gitignore): ignore .idea folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3c3629e..eb79dd5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +.idea