Socket
Socket
Sign inDemoInstall

tesseract.js-core

Package Overview
Dependencies
0
Maintainers
4
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tesseract.js-core

Tesseract C++ API in Pure Javascript


Version published
Maintainers
4
Created

Changelog

Source

Version 3.0.0

Version 3.0.0 changes provide (1) a significant improvement in performance and (2) compatibility with Node.js 18.

  • Updates Tesseract to version 5
  • Added SIMD-enabled build
    • This version is significantly faster on supported devices
    • As SIMD support is only available on certain browsers/devices, it will be up to Tesseract.js and/or application developers to serve the correct version
  • Depreciated asm.js build
    • This version is not deleted, however has not been updated and will be deleted in next major release
  • Updated emscripten version for compatibility with Node.js 18
  • Refactored build scripts
  • Added benchmark examples
  • Added argument to rotate image based on exif orientation tag
    • Orientation must be specified (not detected automatically)

Readme

Source

tesseract.js-core

Core part of tesseract.js, which compiles original tesseract from C to JavaScript WebAssembly.

Structure

  1. Build scripts are in build-scripts folder
  2. Javascript/wrapper files are in javascript folder
  3. All dependencies (including Tesseract) are in third_party folder
    1. All dependencies are unmodified except for Tesseract, which uses a forked repo
    2. The Tesseract repo has the following changes:
      1. Modified CMakeLists.txt to build with emscripten
      2. Modified ltrresultiterator.h and ltrresultiterator.cpp to add WordChoiceIterator class
      3. Added src/arch_see folder, which is used instead of src/arch for the simd-enabled build
        1. This hard-codes the use of the SSE function
      4. Commented out "Empty page!!" message in src/textord/colfind.cpp to prevent this from printing to console
      5. Modified src/ccmain/thresholder.cpp, src/ccmain/thresholder.h, src/api/baseapi.cpp, and include/tesseract/baseapi.h to add option for rotating images using exif orientation tag

Running Minimal Examples

To run the browser examples, launch a web server in the root of the repo (i.e. run http-server). Then navigate to the pages in examples/web/minimal/ in your browser.

To run the node examples, navigate to examples/node/minimal/ and then run e.g. node index.wasm.js.

The "benchmark" examples behave similarly, except that they take longer to run and report runtime instead of recognition text. All other examples are experimental and should not be expected to run.

Contribution

As we leverage git-submodule to manage dependencies, remember to add recursive when cloning the repository:

$ git clone --recursive https://github.com/naptha/tesseract.js-core

To build tesseract-core.js by yourself, please install docker and run:

$ bash build-with-docker.sh

The genreated files will be stored in root path.

Keywords

FAQs

Last updated on 19 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc