From adbce241285be975b868bf4c446b76e2e5f8ceac Mon Sep 17 00:00:00 2001 From: terrtia Date: Thu, 2 May 2024 10:36:20 +0200 Subject: [PATCH] fix: [ocr] catch cv2 errors --- bin/modules/OcrExtractor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/modules/OcrExtractor.py b/bin/modules/OcrExtractor.py index cc9ea8db..b96c030e 100755 --- a/bin/modules/OcrExtractor.py +++ b/bin/modules/OcrExtractor.py @@ -9,6 +9,7 @@ The OcrExtractor Module ################################## # Import External packages ################################## +import cv2 import os import sys @@ -103,7 +104,7 @@ class OcrExtractor(AbstractModule): print(image.id, languages) try: texts = Ocrs.extract_text(path, languages) - except (OSError, ValueError) as e: + except (OSError, ValueError, cv2.error) as e: self.logger.warning(e) self.obj.add_tag('infoleak:confirmed="false-positive"') texts = None