QR Code NotFoundException on text containing "=="

63 views
Skip to first unread message

Dimitry

unread,
May 30, 2017, 7:00:06 PM5/30/17
to zxing
Hello,

I am trying to read a chunk of Base64 encoded data with QRCodeReader().decode(binaryBitmap, hintMap);

Everything works until the QRCode has == double equals characters (Base64 padding).

Example: ZG9kb2RvCg==

If the offending characters are encountered I get NotFoundException. I have tried various combinations of CHARACTER_SET in hints but so far no success.

hintMap.put(DecodeHintType.CHARACTER_SET, CharacterSetECI.UTF8);
hintMap.put(DecodeHintType.TRY_HARDER, true);

Screenshot of the QRCode is attached. Any solution or workaround is appreciated.

screenshot_1460.png

Zorawar B.

unread,
May 30, 2017, 9:51:44 PM5/30/17
to zxing

Adding the pure barcode hint decodes it.
hintMap.put(DecodeHintType.PURE_BARCODE, Boolean.TRUE);

Regards,
Zorawar


Lachezar Dobrev

unread,
May 31, 2017, 4:08:23 AM5/31/17
to Dimitry, zxing
Reads just fine using my phone off the screen.
Rotating the code 90° also makes it readable.
I suspect you're hitting some corner case, which has nothing to do
with the actual contents.
> --
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to zxing+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Dimitry

unread,
May 31, 2017, 11:02:57 PM5/31/17
to zxing

Thank you. For some reason when I increased the version of the QR Code to min:13 to max:21 on the producer side I have seen the issue go away. Perhaps it had to do with the size of data (64 bytes) I was encoding into the QR Code.

Sean Owen

unread,
Jun 4, 2017, 10:38:38 AM6/4/17
to zxing
Reply all
Reply to author
Forward
0 new messages