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

Unable to create QR codes with modes less than binary/'bytes' #122

Closed
cjtenny opened this issue May 28, 2023 · 2 comments
Closed

Unable to create QR codes with modes less than binary/'bytes' #122

cjtenny opened this issue May 28, 2023 · 2 comments

Comments

@cjtenny
Copy link

cjtenny commented May 28, 2023

I think https://github.com/heuer/segno/blob/master/segno/encoder.py#L1040 will cause https://github.com/heuer/segno/blob/master/segno/encoder.py#L1049 to always fail for numeric, alphanumeric, and structured append modes. Specifically, I'm trying to create an alphanumeric microQR code in mode M2 with the following line:

segno.make_micro("text", version="M2", mode="alphanumeric")

And I don't think Segno will allow me to do it with any data - but I'm pretty tired right now. Maybe I'm missing something?

@cjtenny
Copy link
Author

cjtenny commented May 28, 2023

Oops - turns out the alphanumeric mode is only selectable with uppercase characters, there's no case-folding. My thoughts about the code-path were wrong. Closing, sorry!

@cjtenny cjtenny closed this as completed May 28, 2023
@heuer
Copy link
Owner

heuer commented May 28, 2023

Glad you found it out yourself. In alphanumeric mode the following characters are allowed: ABCDEFGHIJKLMNOPQRSTUVWXYZ$%*+-./:, and space .

If the version does not matter, you can omit the mode and version information and Segno creates an optimal, minimal Micro QR Code for the provided input:

>>> qr = segno.make_micro("text")
>>> qr.designator
'M3-M'

The Structured Append mode is not supported by Micro QR Codes, only by QR Codes.

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