Skip to content

Commit

Permalink
Edited setImage to throw error for invalid images per #699
Browse files Browse the repository at this point in the history
  • Loading branch information
Balearica committed Dec 10, 2022
1 parent b53427f commit d7d0c2e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"opencollective-postinstall": "^2.0.2",
"regenerator-runtime": "^0.13.3",
"resolve-url": "^0.2.1",
"tesseract.js-core": "^4.0.0",
"tesseract.js-core": "^4.0.1",
"wasm-feature-detect": "^1.2.11",
"zlibjs": "^0.3.1"
},
Expand Down
3 changes: 2 additions & 1 deletion src/worker-script/utils/setImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ module.exports = (TessModule, api, image, angle = 0) => {
TessModule.FS.writeFile('/input', image);
}

api.SetImageFile(exif, angle);
const res = api.SetImageFile(exif, angle);
if (res === 1) throw Error('Error attempting to read image.');
};

0 comments on commit d7d0c2e

Please sign in to comment.