mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-26 07:47:17 +00:00
fix: [qrcode extractor] fix invalid jpeg
This commit is contained in:
parent
526566720b
commit
8d0f85294a
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue