diff --git a/LunaTranslator/LunaTranslator/ocrengines/local.py b/LunaTranslator/LunaTranslator/ocrengines/local.py index d8814f24..1f61806f 100644 --- a/LunaTranslator/LunaTranslator/ocrengines/local.py +++ b/LunaTranslator/LunaTranslator/ocrengines/local.py @@ -35,8 +35,10 @@ class ocrwrapper: self._OcrInit(det,rec,key) def ocr(self,path,name,angle=0): try: - self._OcrDetect(path,name,angle) - return self._OcrGet().decode('utf8') + if (self._OcrDetect(path,name,angle) ): + return self._OcrGet().decode('utf8') + else: + return '' except: return ''