# OCR engine files in this directory

These files are copied, unmodified, from npm packages listed in `package.json`. `scripts/security/sync-ocr-assets.mjs` makes the copy; the package versions, the SHA-256 of every file and the file each copy comes from are recorded in `manifest.security.json` and checked by `npm run security:wasm`, which also fails if a copy differs from the installed package's file or if an unrecorded file sits here.

| Files | What | Licence | Source |
|---|---|---|---|
| `<version>/worker.min.js` | tesseract.js: the worker script that runs the engine in the browser | Apache-2.0, see `LICENSE-tesseract.js.md` and `worker.min.js.LICENSE.txt` | https://github.com/naptha/tesseract.js |
| `<version>/tesseract-core-simd-lstm.js` and `.wasm`, `tesseract-core-lstm.js` and `.wasm` | tesseract.js-core: the Tesseract OCR engine compiled to WebAssembly, in two builds. A browser with WebAssembly SIMD loads the first, any other the second | Apache-2.0, see `LICENSE-tesseract.js-core` | https://github.com/naptha/tesseract.js-core (Tesseract: https://github.com/tesseract-ocr/tesseract) |
| `<version>/eng.traineddata.gz` | The English recognition model (`4.0.0_best_int`), from the npm package `@tesseract.js-data/eng` | The model is from the Tesseract project's tessdata, Apache-2.0; the npm package that carries it declares MIT | https://github.com/naptha/tessdata (https://github.com/tesseract-ocr/tessdata_best) |

The engine binaries also contain libraries the Tesseract engine is built with, as compiled by the tesseract.js-core project: Leptonica (BSD-2-Clause, http://www.leptonica.org), libpng, libjpeg, libtiff and zlib, each under its own permissive licence with a notice requirement. This list is taken from names found in the binaries and may not be complete; the tesseract.js-core project's build is the authority. `worker.min.js` bundles small JavaScript libraries; the notices its build emitted are in `worker.min.js.LICENSE.txt`.

The engine fetches these files from this site only, under `/ocr/<version>/`.
