Fix KeyError on unexpected tess output

This commit is contained in:
James R. Barlow
2016-02-17 06:05:27 -08:00
parent fcb89b0c58
commit 3b98a1a04b
+2 -2
View File
@@ -107,8 +107,8 @@ def get_orientation(input_file, language: list, timeout: float, log):
osd[parts[0].strip()] = parts[1].strip()
oc = OrientationConfidence(
angle=int(osd['Orientation in degrees']),
confidence=float(osd['Orientation confidence']))
angle=int(osd.get('Orientation in degrees', 0)),
confidence=float(osd.get('Orientation confidence', 0)))
return oc