diff --git a/.gitignore b/.gitignore index 3c3629e..eb79dd5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules +.idea diff --git a/lib/tesseract.js b/lib/tesseract.js index 2f7e13c..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 }, /** @@ -63,7 +64,7 @@ var Tesseract = { } if (options.psm !== null) { - command.push('-psm ' + options.psm); + command.push('--psm ' + options.psm); } if (options.config !== null) { @@ -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) {