Account for KeyError problem in #345

This commit is contained in:
Daniel Quinn 2018-04-28 12:19:53 +01:00
parent 1522af2ea5
commit f3f86242de

View File

@ -285,7 +285,7 @@ def image_to_string(args):
try:
orientation = ocr.detect_orientation(f, lang=lang)
f = f.rotate(orientation["angle"], expand=1)
except (TesseractError, OtherTesseractError):
except (TesseractError, OtherTesseractError, KeyError):
pass
return ocr.image_to_string(f, lang=lang)