Skip to content

Commit

Permalink
build(deps): bump tesseract.js from 4.1.2 to 5.0.0 (#1670)
Browse files Browse the repository at this point in the history
* build(deps): bump tesseract.js from 4.1.2 to 5.0.0

Bumps [tesseract.js](https://github.com/naptha/tesseract.js) from 4.1.2 to 5.0.0.
- [Release notes](https://github.com/naptha/tesseract.js/releases)
- [Commits](naptha/tesseract.js@v4.1.2...v5.0.0)

---
updated-dependencies:
- dependency-name: tesseract.js
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* refactor(plugins/image-to-txt): update for tesseract api changes

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Frazer Smith <[email protected]>
  • Loading branch information
dependabot[bot] and Fdawgs authored Sep 28, 2023
1 parent 1c62cfd commit 8e99fee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
16 changes: 8 additions & 8 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 @@ -139,7 +139,7 @@
"pino": "^8.15.1",
"redoc": "^2.1.2",
"secure-json-parse": "^2.7.0",
"tesseract.js": "^4.1.2",
"tesseract.js": "^5.0.0",
"upath": "^2.0.1",
"word-extractor": "^1.0.4"
}
Expand Down
10 changes: 6 additions & 4 deletions src/plugins/image-to-txt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function plugin(server, options) {
cachePath: joinSafe(__dirname, "../../.."),
corePath: joinSafe(
__dirname,
"../../../node_modules/tesseract.js-core/tesseract-core.wasm.js"
"../../../node_modules/tesseract.js-core"
),
langPath: joinSafe(__dirname, "../../../ocr_lang_data"),
workerPath: joinSafe(
Expand All @@ -54,9 +54,11 @@ async function plugin(server, options) {
Array(options.workers)
.fill(0)
.map(async () => {
const worker = await createWorker(workerConfig);
await worker.loadLanguage(options.languages);
await worker.initialize(options.languages);
const worker = await createWorker(
options.languages,
1,
workerConfig
);
await worker.setParameters(workerParams);
return scheduler.addWorker(worker);
})
Expand Down

0 comments on commit 8e99fee

Please sign in to comment.