feat: surface raw Tesseract diacritics message at debug level

When Tesseract reports a page with many diacritics, OCRmyPDF rewrites the
message to "lots of diacritics - possibly poor OCR", which hid the
original wording. Keep the interpreted hint but also emit Tesseract's raw
line at debug verbosity (-v 1) so users can see exactly what Tesseract
reported.

Closes #1566.
This commit is contained in:
James R. Barlow
2026-06-11 00:21:39 -07:00
parent 11de13ecfe
commit 8a8d515933
3 changed files with 16 additions and 0 deletions
+4
View File
@@ -297,6 +297,10 @@ def tesseract_log_output(stream: bytes) -> None:
continue
elif 'diacritics' in line:
tlog.warning("lots of diacritics - possibly poor OCR")
# Surface the raw Tesseract message at debug level so users can see
# exactly what Tesseract reported (e.g. the affected count) without
# losing the interpreted hint above (#1566).
tlog.debug(line.strip())
elif line.startswith('OSD: Weak margin'):
tlog.warning("unsure about page orientation")
elif 'Error in pixScanForForeground' in line: