From ee02a72288c0cc8d51b871d894850a08d5567afc Mon Sep 17 00:00:00 2001 From: terrtia Date: Wed, 2 Oct 2024 15:35:04 +0200 Subject: [PATCH] fix: [qrcode extractor] filter invalid image --- bin/modules/QrCodeReader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/modules/QrCodeReader.py b/bin/modules/QrCodeReader.py index d23e9942..ecd9e951 100755 --- a/bin/modules/QrCodeReader.py +++ b/bin/modules/QrCodeReader.py @@ -54,8 +54,8 @@ class QrCodeReader(AbstractModule): try: image = cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB) except cv2.error: - print(self.obj.get_global_id()) - image = cv2.imread(path) + self.logger.warning(f'Invalid image: {self.obj.get_global_id()}') + return [] try: decodeds = decode(image)