A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/naptha/tesseract.js/issues/771 below:

Upgrading from v2 to v5 Guide · Issue #771 · naptha/tesseract.js · GitHub

Overview

According to npm statistics (and Git Issues), many users are still using Tesseract.js v2. Version 2 was released in 2019 and includes many bugs, memory leaks, and performance issues that have been fixed in subsequent versions (in some cases v2 is 20x slower than the current version), so updating is strongly recommended. Additionally, v2 is no longer supported, so updating is a requirement to receive support in Git Issues.

While the changes made in each release are fully documented, to make upgrading as easy as possible, below is a guide describing all changes that v2 users may need to make to use the latest version. This guide describes the process of upgrading from v2 to v5. If (for whatever reason) you wish to update from v2 to v4, see the comment below.

Changes Impacting Most Users
  1. createWorker is now async
  2. The arguments to createWorker have changed--the first two arguments are now language and oem
    1. E.g. createWorker('eng', 1, { logger: m => console.log(m) })
  3. worker.load, worker.loadLanguage, and worker.initialize are no longer needed
Changes Impacting Fewer Users
  1. Electron users
  2. Users of getPDF function
  3. Users who set cacheMethod: 'none' or cacheMethod: 'refresh' as workaround for caching bug
  4. Users who set the optional corePath argument
  5. Node.js <14 users
  6. Users of worker.detect function
    1. This function is now disabled by default
    2. To enable, set arguments legacyCore: true and legacyLang: true in createWorker options
      1. E.g. Tesseract.createWorker("eng", 1, {legacyCore: true, legacyLang: true})
  7. Users who implemented progress bars using log messages
    1. The language used in logs was standardized, so any scripts that parse logs may need to be updated

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4