mirror of
https://github.com/kaffarell/obsidian-tesseract-ocr.git
synced 2026-07-22 07:40:26 +00:00
fix #3: error out only when stdout is empty
When executing tesseract, sometimes we get the correct output on stdout and an error on stderr, in that case we simply use the stdout and discard the error. Bump to version 0.3.8.
This commit is contained in:
parent
548c545f77
commit
d65f48ac9d
4 changed files with 6 additions and 4 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "image-ocr",
|
||||
"name": "Image OCR",
|
||||
"version": "0.3.7",
|
||||
"version": "0.3.8",
|
||||
"minAppVersion": "0.15.0",
|
||||
"description": "Runs OCR on images and copies content in image caption.",
|
||||
"author": "kaffarell",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "image-ocr",
|
||||
"version": "0.3.7",
|
||||
"version": "0.3.8",
|
||||
"description": "Runs ocr on pasted images and posts result in details box. This allows to search in images.",
|
||||
"main": "dist/main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -174,7 +174,8 @@ export default class TesseractOcrPlugin extends Plugin {
|
|||
execution.on('close', () => {
|
||||
if (this.settings.debug == true) console.log('tesseract output: ' + stdout.join(''));
|
||||
if (this.settings.debug == true) console.log('tesseract output: ' + error.join(''));
|
||||
if (error.length) reject(error.join(''));
|
||||
// if we don't get any output, reject
|
||||
if (stdout.join('').length == 0) reject(error.join(''));
|
||||
else resolve(stdout.join(''));
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -8,5 +8,6 @@
|
|||
"0.3.4": "0.15.0",
|
||||
"0.3.5": "0.15.0",
|
||||
"0.3.6": "0.15.0",
|
||||
"0.3.7": "0.15.0"
|
||||
"0.3.7": "0.15.0",
|
||||
"0.3.8": "0.15.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue