From image to editable text: orientation and languages
Getting started
This site has exactly one operation, image-to-text. Documentation pages are fully static and never load an OCR model; only the /app/ workspace prepares resources on demand.
1. Pick languages
Use eng for English, chi_sim for Simplified Chinese, and eng+chi_sim for mixed text. traineddata is downloaded only when needed: cached languages are not requested again and changes fetch only missing files. Resources must be self-hosted or come from a stable configured source, cached by version.
2. Fix orientation
Apply EXIF orientation (1–8) first, then add a manual 0/90/180/270° rotation. For example EXIF=6 means clockwise 90°; a further 270° rotation returns text upright. Skipping orientation turns sideways lines into reversed characters. The corrected image enters the recognize phase only afterwards.
3. Phases and cancellation
States are validate → load-language → recognize → complete. Upstream logger events map to phase names only; no end-to-end percentage is invented. Cancelling terminates the worker and stops CPU slices; the next run reinitializes it, while a completed worker is reused.
4. Proofread and export
Recognition may contain errors and no absolute accuracy is claimed. Results are editable and re-recognition warns before overwriting edits. TXT is UTF-8 without mojibake; copy preserves line breaks. Original images are never uploaded and text is never logged.
Scope of this round
There is no browser binary and no real Tesseract.js / WASM / worker / traineddata test. The workspace ships three deterministic demo samples (clear English, Simplified Chinese, mixed) plus an orientation sample from an injectable adapter, marked demo; uploading a real file reports that the real OCR engine is unavailable. Production integration needs self-hosted core / worker / language data and real-device acceptance.