Barcode Scanner crashes when scanning PDF-417 barcodes.

163 views
Skip to first unread message

Matthew Moses

unread,
Jul 23, 2013, 11:41:35 AM7/23/13
to zx...@googlegroups.com
Hello,

Our Android apps currently support barcode scanning via integration with Barcode Scanner (or BS+). Initially, we were only concerned with QRCode barcodes. Due to the high volume of legacy barcodes we have in the wild using PDF-417, however, we've been asked to also support that symbology. So, I've been evaluating the PDF-417 support in BS. While BS+ will successfully read most of our samples, BS crashes (see exception below) unless the camera is already perfectly aligned with the target barcode prior to BS being launched. This happens with both the released version, and a version built from the latest source code.

I realize the project page lists PDF-417 as being "alpha" quality, so I'm just trying to get a sense of the current state of development and future plans for PDF-417 in Barcode Scanner to figure out what options we have. We might be able to spend some time assisting in the PDF-417 development effort.

FATAL EXCEPTION: main
java.lang.NullPointerException
    at com.google.zxing.client.android.CaptureActivity.drawResultPoints(CaptureActivity.java:471)
    at com.google.zxing.client.android.CaptureActivity.handleDecode(CaptureActivity.java:416)
    at com.google.zxing.client.android.CaptureActivityHandler.handleMessage(CaptureActivityHandler.java:100)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5227)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
    at dalvik.system.NativeStart.main(Native Method)

Thanks,
Matthew Moses

Sean Owen

unread,
Jul 23, 2013, 11:44:28 AM7/23/13
to zx...@googlegroups.com
That's coming from the app, not the decoding library, so it's nothing to do with PDF417 itself. I haven't seen it before but maybe it's a corner case. It should be simple, just 'cosmetic' really. Do you have an example of something that triggers this?

Ralf Kistner

unread,
Jul 24, 2013, 7:07:00 AM7/24/13
to zx...@googlegroups.com
Hi Sean,

I got the same issue quite often, specifically with PDF417 barcodes. For some reason one of the ResultPoints is null in some cases.

I haven't investigated the cause, but I worked around it by just skipping null ResultPoints in my fork: https://github.com/embarkmobile/zxing-android-minimal/commit/7708f2efff7da3215c22dfbf3bd15f6ba6d8fe86

I also got some other decoding exceptions (ArrayIndexOutOfBoundsException if I remember correctly) with PDF417 barcodes, which I worked around by catching all exceptions (instead of just ReaderExceptions) in DecodeHandler: https://github.com/embarkmobile/zxing-android-minimal/commit/8fee654b06ee1cf0069b46e10c2d874943d99c5d

If you need more info I can try reproduce these errors again.

Regards,
Ralf

Sean Owen

unread,
Jul 24, 2013, 7:08:10 AM7/24/13
to zx...@googlegroups.com
Yeah I just did the same thing. It's in HEAD now in SVN.

Matthew Moses

unread,
Jul 29, 2013, 8:09:03 AM7/29/13
to zx...@googlegroups.com
Sorry for the delay in responding. We've been crazy busy and the "Email updates to me" option did not, in fact, email updates to me.

I do have sample barcodes if you still need/want them. I was supposed to attach them to the initial message, but I forgot. It sounds like you guys have a handle on the problem though. I'll update to the latest from SVN and give it a try when I get to work this morning.

Guenther Grau

unread,
Sep 10, 2013, 12:06:42 PM9/10/13
to zx...@googlegroups.com
Hi Ralf,

PDF417 allows for truncated barcodes (called compact PDF417). In those cases, some result points might be null. If you have an example image, I could look into it, but the caller must not assume all result points be present for PDF417.

Best regards,

  Guenther
Reply all
Reply to author
Forward
0 new messages