When trying to read a qr code contain a url and set the value of dct to True, the function will panic
from fatoora import Fatoora
obj = Fatoora(
seller_name="Awiteb",
tax_number=1234567891,
invoice_date=1635872693.3186214,
total_amount=100,
tax_amount=15,
qrcode_url="https://example.com",
)
obj.qrcode("tests.png")
obj.read_qrcode("tests.png", dct=True)
Traceback (most recent call last):
File "~/Desktop/projects/python-projects/fatoora/t.py", line 14, in <module>
obj.read_qrcode("tests.png", dct=True)
File "~/Desktop/projects/python-projects/fatoora/fatoora/fatoora.py", line 127, in read_qrcode
return cls.base2dict(data)
File "~/Desktop/projects/python-projects/fatoora/fatoora/fatoora.py", line 98, in base2dict
decoded = base64.b64decode(base)
File "/usr/lib/python3.10/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Invalid base64-encoded string: number of data characters (17) cannot be 1 more than a multiple of 4