ChecksumException in zxing QRCodeReader when NOT reading a QR-code with an URL

Viewed 4154

The following code works perfectly and fast if I am scanning a QR code with an URL. However, if I am decoding a QR code with a simple string or number sequence (which is what I would like to do), it randomly works sometimes, but 99% of the time it keeps failing with a ChecksumException.

if (webcam.isOpen()) {

            if ((image = webcam.getImage()) == null) {
                continue;
            }

            LuminanceSource source = new BufferedImageLuminanceSource(image);
            BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));

            try {
                result = new QRCodeReader().decode(bitmap);
            } catch (NotFoundException e) {
                 //exception handling omitted
            } catch (ChecksumException ex) {
                //exception handling omitted
            } catch (FormatException ex) {
               //exception handling omitted
            }
        }

Has anybody experienced this before? What could be the solution?

BTW I am generating the codes with http://goqr.me/

2 Answers
Related