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
Version Selection is wrong for certain string length #164
Comments
|
It isn't just the length of the string taken into account, but the contents. Digits can be encoded more succinctly, so when 4 in a row are found, we switch encoding for that block meaning those extra numbers can use less space than encoded as alphanumeric |
It has nothing to do with digits! I've just used them for illustrating. It is the same when only letters are used! |
ABCDEFGHIJKLMNOPQRSTU -> Version 1 (21x21) |
It was still an issue with mode encoding, the case was just a bit different. |
Hi, I've noticed that the version is sometimes not selected correctly, depending on length of the string.
ABCDEFGHIJKLMNO1 -> Version 1 (21x21)
ABCDEFGHIJKLMNO12 -> Version1 (21x21)
ABCDEFGHIJKLMNO123 -> Version2 (25x25)
ABCDEFGHIJKLMNO1234 -> Version2 (25x25)
ABCDEFGHIJKLMNO12345 -> Version1 (21x21)
ABCDEFGHIJKLMNO123456 -> Version1 (21x21)
Forcing to Level 1 (fit=False) gives the error:
qrcode.exceptions.DataOverflowError: Code length overflow. Data size (156) > size available (152)
The text was updated successfully, but these errors were encountered: