fix: [qrcode extractor] fix invalid jpeg

pull/607/merge
terrtia 2024-10-02 15:30:29 +02:00
parent 526566720b
commit 8d0f85294a
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 5 additions and 1 deletions

View File

@ -51,7 +51,11 @@ class QrCodeReader(AbstractModule):
def extract_qrcode(self, path):
qr_codes = False
contents = []
image = cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB)
try:
image = cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB)
except cv2.error:
image = cv2.imread(path)
try:
decodeds = decode(image)
for decoded in decodeds: