mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
fix(labs): serve the in-browser OCR engine from this origin
Local lab OCR reads a report photo on the device with tesseract.js, whose defaults load the worker, the WebAssembly core and the language data from cdn.jsdelivr.net. The production CSP allows workers and fetches only from this origin, so the engine could not load; where it did load (dev), the browser of anyone scanning a report contacted a third-party CDN. The worker, the three LSTM core builds and the deu and eng best_int language data (about 17 MB) are now copied from pinned packages into public/tesseract/ at prebuild and predev, and createWorker is pointed at them with the worker started from its URL rather than a blob. A test holds the options against the staged file list.
This commit is contained in:
1 parent
94ac863bdf
commit
2c88acc5f7
6 files changed
+193
-3
No files matched your search
@@ -55,6 +55,9 @@ next-env.d.ts
|
||||
# the cache-version baseline.
|
||||
/public/sw-version.js
|
||||
/public/i18n/
|
||||
# In-browser OCR engine and language data, copied from node_modules by
|
||||
# scripts/stage-tesseract-assets.mjs at prebuild/predev.
|
||||
/public/tesseract/
|
||||
|
||||
# v1.4.27 B3 — MaxMind GeoLite2 databases are fetched at build time
|
||||
# via `scripts/fetch-geolite2.sh`. Too large for git; license key
|
||||
|
||||
Reference in new issue
Block a user