Skip to content

Bundle in-process Tesseract with English, keep external installs working - #711

Merged
TheJoeFin merged 6 commits into
devfrom
bundle-tess
Nov 15, 2026
Merged

TheJoeFin merged 6 commits into
devfrom
bundle-tess

Conversation

@TheJoeFin

Copy link
Copy Markdown
Owner

Summary

  • Ships Tesseract inside Text Grab using Tesseract.CrossPlatform (in-process, win-x64 and win-arm64), with the tessdata_fast English model bundled.
  • New TesseractEngineMode setting, decided once: a saved TesseractPath that still exists keeps the legacy tesseract.exe path (External); everyone else gets Bundled. The decision never runs the install probe. UseTesseract stays off by default.
  • TesseractHelper is now a facade over BundledTesseractBackend and the frozen ExternalTesseractBackend; callers gate on a mode-aware IsAvailable().
  • Language data lives in a writable tessdata folder (MSIX local folder, next to the exe, or the automation profile dir); downloaded models override bundled ones. No UAC prompt for downloads.
  • Downloader hardened: result type, progress, cancellation, .tmp write, size validation.
  • Tesseract settings page redesigned (Bundled and External forms); language page links to it in Bundled mode.
  • License notices added; design and findings are in docs/Spike-Bundling-Tesseract.md.

Testing

  • Tests (1047), Tests.Core.Windows (335) and Tests.Core (1285) all pass on win-arm64, including a new end-to-end test that OCRs font_sample.png with the bundled engine and tests for the mode migration, tessdata locator and downloader.

Not verified yet

  • MSIX install and OCR in the packaged app.
  • Unpackaged single-file Text-Grab.exe (native loader workaround, bundled model reachability).
  • Output parity against the installed tesseract.exe on the OCR fixtures.
  • UI tests (OcrCapability.Tests.ps1, coverage.json) still probe for an external install and were not updated.
  • The new settings page has not been clicked through in the running app.

🤖 Generated with Claude Code

TheJoeFin and others added 6 commits November 14, 2026 16:54
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Empty until decided, then Bundled or External. Automation profiles are
seeded as Bundled so UI tests stay isolated from the real user.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
TesseractHelper becomes a facade over BundledTesseractBackend
(Tesseract.CrossPlatform, with bundled English) and the frozen
ExternalTesseractBackend. The engine mode is decided once from the saved
TesseractPath without running the install probe. Callers gate on the
mode-aware IsAvailable(). Includes the tessdata locator and tests.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The downloader now reports a result, supports progress and cancellation,
and validates a .tmp file before moving it into place. The Tesseract page
gets Bundled and External forms with a language list, download picker,
engine status and engine switching. The language page links to it in
Bundled mode.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@TheJoeFin
TheJoeFin merged commit 22e3853 into dev Nov 15, 2026
1 check passed
@TheJoeFin
TheJoeFin deleted the bundle-tess branch November 15, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant