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

Excessive version selected, mode optimisation support? #111

Open
Synchro opened this issue Jul 6, 2022 · 1 comment
Open

Excessive version selected, mode optimisation support? #111

Synchro opened this issue Jul 6, 2022 · 1 comment

Comments

@Synchro
Copy link

Synchro commented Jul 6, 2022

I'm generating a QR from a URL that has 48 ASCII chars and using Q redundancy, which should mean the total data size is 60 bytes. For that amount of data, this library generates a 37x37 version 5 QR. Looking at this chart, I can see that the capacity of a version 5 does correspond to 60 bytes in "binary" mode, but version 4 can accommodate 67 bytes in "alphanumeric" mode. This chart shows that that this set includes :, ., and / which is all that's needed for URL support, but it does not support lower-case chars. So now I'm mystified because I have a QR generated by a different system that is a version 4 and successfully encodes my URL containing lower-case chars with the correct degree of redundancy.

I suspect that this is due to the other system supporting mode optimisation, where the data can be split into chunks, each with a different encoding mode, for example if my URL contains https://www.example.com/ABC1234567890/XYZ, this could be encoded as a byte-mode chunk of https://www.example.com followed by an alphanumeric chunk of /ABC1234567890/XYZ, or possibly even finer chunks if 1234567890 could be dropped to numeric mode.

This page has an excellent demonstration of mode optimization along with a detailed description of how it works.

Do you have any plans to implement this optimisation so we can have smaller QRs?

@Synchro Synchro changed the title Excessive version selected Excessive version selected, mode optimisation support? Jul 6, 2022
@DASPRiD
Copy link
Member

DASPRiD commented Mar 19, 2024

I don't personally plan to make any future enhancements, but I'm open to accept PRs.

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

No branches or pull requests

2 participants