fix: [qrcode extractor] filter invalid image

This commit is contained in:
terrtia 2024-10-02 15:35:04 +02:00
parent 09260f68ae
commit ee02a72288
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -54,8 +54,8 @@ class QrCodeReader(AbstractModule):
try: try:
image = cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB) image = cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB)
except cv2.error: except cv2.error:
print(self.obj.get_global_id()) self.logger.warning(f'Invalid image: {self.obj.get_global_id()}')
image = cv2.imread(path) return []
try: try:
decodeds = decode(image) decodeds = decode(image)