Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
a-miscellaneous committed Jul 3, 2024
1 parent 3461c51 commit d0d1c2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions checker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ beautifulsoup4==4.12.3
pillow==10.3.0
pyzbar==0.1.9
segno==1.6.1
qrcode-artistic
requests
tqdm
numpy
opencv-python
requests==2.32.3
tqdm==4.66.4
numpy==1.26.4
opencv-python==4.10.0.84
qreader==3.14
5 changes: 3 additions & 2 deletions checker/src/qr_codes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

RETRIES = 3
SCALE = 12
BORDER = 10
BORDER = 20
background_folder = os.path.join(os.path.dirname(__file__), "backgrounds")
qrReader = QReader()

Expand Down Expand Up @@ -86,9 +86,10 @@ def create_qr_code(flag, scale=SCALE, border=BORDER) -> bytes:
return res


def read_qr_code(image: Image) -> str:
def read_qr_code(image) -> str:
qr_data = decode(image)
if not qr_data:
image = np.array(image)
qr_data = qrReader.detect_and_decode(image)
print("pyzbar failed")
if not qr_data:
Expand Down

0 comments on commit d0d1c2e

Please sign in to comment.