Can't get a version 10 (57x57) QR code recognized by zxing, but is fine with i.e. QR Droid app

146 views
Skip to first unread message

Mathias Lin

unread,
May 9, 2013, 3:08:49 PM5/9/13
to zx...@googlegroups.com
I have a version 10 (57x57) QR code which (almost) never gets recognized in Zxing (I was lucky once, but never again, on Samsung Galaxy S III; and never on Galaxy Tab 2.0):

The same QR code gets recognized very well and fast with another app on Google Play (i.e. QR Droid), so I guess it's not an issue with the devices' cameras.


Any idea what might cause Zxing not being able to recognize a version 10 (57x57) code? Different algorithms? Any idea where/how to improve it?
Thanks!

Sean Owen

unread,
May 9, 2013, 3:28:32 PM5/9/13
to zx...@googlegroups.com
The QR code appears invalid, in that its version info is encoded backwards. It's clearly version 10. I see that it reads as...

110010110010010100

when version 10 should be:

001010010011010011

Now, the thing is, I remember years ago writing this to just try it backwards if it failed, since I had seen some codes in the wild that seemed to get it wrong. But I don't see that in the code anymore and sort of remember it was taken out since it was technically not right anyway and was causing another problem. (QR Droid may have forked the old code). 

I will see if I can remember the specifics and take a second look, but I believe the answer is that this is a technically invalid QR code. It's read just fine if you fix that.

Mathias Lin

unread,
May 9, 2013, 3:32:51 PM5/9/13
to zx...@googlegroups.com
Thanks for the info. I was using a free online QR code generator (at the sample url I posted), don't have the source code of that generator. But knowing what the problem is now, I will look into it or an alternative generator, or create my own.
Thanks again!

Sean Owen

unread,
May 9, 2013, 3:35:35 PM5/9/13
to zx...@googlegroups.com
Ah I'm thinking of FormatInformation actually, where it is tried both masked and unmasked for a match, even though it should only be masked.

Well, similar issue. Supporting reading the value backwards can cause false positive in some cases. It would be rare. Hmm, I suppose if there were some info that this were at all common, or someone can see that there's actually no harm in reading backwards, I can add that change.

Mathias Lin

unread,
May 9, 2013, 3:39:27 PM5/9/13
to zx...@googlegroups.com
Ok understand. I have no idea whether it's common or harmful to allow reading it backwards, maybe somebody can shed some light into it. I'm not too deeply involved in barcode usage in general.
Reply all
Reply to author
Forward
0 new messages