Files
adminandClaude Opus 4.8 ef5ea54b10 Add in-browser OCR (text recognition) top-bar tool
A top-bar tool (#/ocr) to extract text from an image or PDF, running ENTIRELY
in the browser — the document is never uploaded.

- Engine selector (per OCR.md): Tesseract.js (Apache-2.0 WASM, recommended —
  100+ languages via on-demand tessdata) or ocrs (experimental). PDFs reuse the
  PDF.js loader: each page → canvas → OCR. Result box with Copy / Download .txt
  and a progress indicator; drag-drop or browse for the file.
- ocrs has no stable in-browser build yet (verified), so it's a best-effort seam
  (window.OCRS.recognize) that degrades with an honest message pointing at
  Tesseract.js — faithful to OCR.md rather than faking it.
- CSP: allow https://cdn.jsdelivr.net (script/worker/connect) for tesseract.js
  and add 'wasm-unsafe-eval' to script-src (needed to compile the WASM engine;
  narrower than 'unsafe-eval'). Documents stay on the box — only the engine and
  language model are fetched.
- New `scan` icon, full EN/PL i18n, .ocr-drop styling.
- Docs: README feature row, FUNCTIONAL section, CLAUDE invariant, CREDITS
  (tesseract.js/tessdata Apache-2.0, ocrs MIT/Apache-2.0). Commit OCR.md (the
  research/merit) and its linked doc-to-docx research note.

Verified end-to-end in the preview: tesseract.js loaded from jsDelivr under the
new CSP and recognized rendered canvas text exactly ("Galena OCR 12345").

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 14:18:57 +02:00
..