Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic sizing does not attempt sizes 6-9 #27

Closed
jamesbowman opened this issue Jan 19, 2024 · 1 comment
Closed

Automatic sizing does not attempt sizes 6-9 #27

jamesbowman opened this issue Jan 19, 2024 · 1 comment

Comments

@jamesbowman
Copy link
Contributor

With an explicit qr_type of 9, it's possible to make a large pattern

>>> import adafruit_miniqr
>>> _q = adafruit_miniqr.QRCode(qr_type = 9)
>>> _q.add_data(b"x" * 230)
>>> _q.make()
>>> _q.matrix.width
53

But attempting to do the same with automatic sizing gives an error:

>>> import adafruit_miniqr
>>> _q = adafruit_miniqr.QRCode()
>>> _q.add_data(b"x" * 230)
>>> _q.make()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jamesb/Adafruit_CircuitPython_miniQR/adafruit_miniqr.py", line 113, in make
    self.module_count = self.type * 4 + 17
                        ~~~~~~~~~~^~~
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

From inspection, it looks like the code only attempts sizes 1-5.

jamesbowman added a commit to jamesbowman/Adafruit_CircuitPython_miniQR that referenced this issue Jan 19, 2024
@tekktrik
Copy link
Member

Resolved by #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants