Skip to content

Include version number of QR Code and DataMatrix in Result #396

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

Merged
merged 1 commit into from
Sep 1, 2022

Conversation

markusfisch
Copy link
Contributor

Because it's helpful to know which version was actually used for a particular code. We're working with QR Codes a lot and it's often useful to be able to check the exact version.

I realize this is a pretty niche request, but it would have some value for us 😉

Applies to QR Code and DataMatrix.

Because sometimes it can be helpful to know which version was
actually used for a particular code.
@axxel
Copy link
Collaborator

axxel commented Sep 1, 2022

I thought about adding something like that a while back as well. I would have used a different type though, namely a string. That is because the version attribute of a QRCode can actually contain letters (MicroQRCodes are simply QRCodes with version strings starting with 'M'). I'll simply merge your commit and later change the public API before the next release, so be prepared for that.

@axxel axxel merged commit c5ef3c7 into zxing-cpp:master Sep 1, 2022
@markusfisch
Copy link
Contributor Author

Great! Thank you! 😄

I used an int because that's the type in Version - but the MicroQR argument makes a lot of sense, of course. Thanks for the warning 😉

@markusfisch markusfisch deleted the include_version branch September 1, 2022 20:11
@axxel
Copy link
Collaborator

axxel commented Jan 23, 2023

I just realized (after the 2.0 release unfortunately) that the DataMatrix specification actually does not have a notion of a version number. That number is more an implementation detail of the library but does not translate to "googleable" information like the QRCode version does. It seems to me that the right information to be returned here is the size of the symbol, e.g. 22x22 or 8x18 (see also https://www.activebarcode.de/codes/datamatrix_examples).

Having typed this text, I just realized that a more general information than this "version" could have been the size of the symbol (width and height) in modules right from the start. That would be pretty much self-explanatory and also work for all currently supported 2D symbologies.

Since you proposed it initially: how do you use that version information?

@markusfisch
Copy link
Contributor Author

In my company we actually use the (QR Code) version number always in conjunction with the amount of modules, which we compute from the version number (versionNumber * 4 + 17).

This is useful, for example, when we have to create QR Codes in very limited space (on packages and documents) that still have to be readable with normal smartphones. Knowing the exact number of modules makes this process easier and faster. We also found it quite useful when we have to check (and compare) QR Codes from other solutions.

So, yes, a more general information giving just the size of the read symbol in modules would be just as good! And it would probably make more sense for other barcode formats too.

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

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy