From a13c398c064743371ba3e1245a858a7b59d53474 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 5 Jun 2018 23:26:28 -0700 Subject: [PATCH] Suppress some spurious tesseract errors --- src/ocrmypdf/exec/tesseract.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ocrmypdf/exec/tesseract.py b/src/ocrmypdf/exec/tesseract.py index 2660ddae..3f1f4089 100644 --- a/src/ocrmypdf/exec/tesseract.py +++ b/src/ocrmypdf/exec/tesseract.py @@ -188,6 +188,10 @@ def tesseract_log_output(log, stdout, input_file): log.warning(prefix + "lots of diacritics - possibly poor OCR") elif line.startswith('OSD: Weak margin'): log.warning(prefix + "unsure about page orientation") + elif 'Error in pixScanForForeground' in line: + pass # Appears to be spurious/problem with nonwhite borders + elif 'Error in boxClipToRectangle' in line: + pass # Always appears with pixScanForForeground message elif 'error' in line.lower() or 'exception' in line.lower(): log.error(prefix + line.strip()) elif 'warning' in line.lower():