Skip to content

Commit

Permalink
fix: [ocr] catch cv2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed May 2, 2024
1 parent e21257a commit adbce24
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/modules/OcrExtractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
##################################
# Import External packages
##################################
import cv2
import os
import sys

Expand Down Expand Up @@ -103,7 +104,7 @@ def compute(self, message):
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
Expand Down

0 comments on commit adbce24

Please sign in to comment.