fix: [qrcode extractor] fix invalid jpeg

This commit is contained in:
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

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: