-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix asynchronous caching bug #666
Comments
Upon further investigation, this appears to already be fixed (at least for Node.js). The following code snippet throws an error consistently in Version 2 however does not throw an error in Version 3.
|
While this issue seems to be largely resolved in version 3 (as stated above), one contributing factor appears to be that when tesseract.js/src/worker-script/index.js Lines 134 to 136 in dd6c40b
I implemented an edit in the dev/v4 branch to no longer do this, which should reduce the number of times the cache is overwritten, and therefore the potential for the file being corrupted. |
See #662 for explanation of Tesseract.js Version 4 changes. List below is auto-generated from commits. * Added image preprocessing functions (rotate + save images) * Updated createWorker to be async * Reworked createWorker to be async and throw errors per #654 * Reworked createWorker to be async and throw errors per #654 * Edited detect to return null when detection fails rather than throwing error per #526 * Updated types per #606 and #580 (#663) (#664) * Removed unused files * Added savePDF option to recognize per #488; cleaned up code for linter * Updated download-pdf example for node to use new savePDF option * Added OutputFormats option/interface for setting output * Allowed for Tesseract parameters to be set through recognition options per #665 * Updated docs * Edited loadLanguage to no longer overwrite cache with data from cache per #666 * Added interface for setting 'init only' options per #613 * Wrapped caching in try block per #609 * Fixed unit tests * Updated setImage to resolve memory leak per #678 * Added debug output option per #681 * Fixed bug with saving images per #588 * Updated examples * Updated readme and Tesseract.js-core version
Closing this issue since the above changes appear to have resolved (nobody has reported an issue since v4). |
There are currently many issues that appear to stem from 2 problems in how caching works at present.
The former appears to be the most common cause of invalid caching data (as this is non-obvious to users). However, cache may be invalid for other reasons. For example, until the last version cache was often invalid because langData responses were cached (see #585). Therefore, it is possible that not all bugs listed below were directly caused by creating workers asynchronously, but hopefully solving the async issue will solve most of it.
Related issues:
The text was updated successfully, but these errors were encountered: