mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-14 18:48:29 +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):
|
def extract_qrcode(self, path):
|
||||||
qr_codes = False
|
qr_codes = False
|
||||||
contents = []
|
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:
|
try:
|
||||||
decodeds = decode(image)
|
decodeds = decode(image)
|
||||||
for decoded in decodeds:
|
for decoded in decodeds:
|
||||||
|
|
Loading…
Reference in a new issue