Fix "too few characters" reported as error by tesseract -psm 0

This commit is contained in:
James R. Barlow
2016-02-21 08:53:34 -08:00
parent 4ca90c106d
commit d446fe5922
+2 -1
View File
@@ -98,7 +98,8 @@ def get_orientation(input_file, language: list, timeout: float, log):
return OrientationConfidence(angle=0, confidence=0.0)
except CalledProcessError as e:
tesseract_log_output(log, e.output, input_file)
if 'Image too large' in e.output:
if ('Too few characters. Skipping this page' in e.output or
'Image too large' in e.output):
return OrientationConfidence(0, 0)
raise e from e
else: