Maximum length for 1d barcodes???

3,907 views
Skip to first unread message

Jan Taks

unread,
Apr 12, 2012, 8:24:44 AM4/12/12
to zx...@googlegroups.com
Hello, 

We are using the zxing barcode scanner in an Android app to scan 1d barcodes from smart electricity meters. There seems to be some kind of maximum size limit. I am trying to scan this barcode but it is not recognized (using a 5MP camera): 


image.php.png

When I try a shorter code (minus 3 digits), it works like a dream: 


image.php.png


Any ideas on how to make this work? 

Thanks - Jan Taks.



Sean Owen

unread,
Apr 12, 2012, 8:31:42 AM4/12/12
to zx...@googlegroups.com
There is no maximum. However in practice, very long codes are hard to scan, so you run into a practical limit. It's much better to use QR codes for this kind of information.

The camera resolution is irrelevant; it's the preview resolution, and focus, that matter.

You might look at Barcode Scanner+ to scan these as it can optionally use different focus modes, higher preview resolution, and different algo for 1D barcodes.

Lachezar Dobrev

unread,
Apr 13, 2012, 11:02:30 AM4/13/12
to Jan Taks, zx...@googlegroups.com
  You should use Code128 for codes with multiple consecutive digits.
It has a very effective encoding scheme for multiple digits.
By the looks of it you're using Code 3-of-9 (Code 39), which is
easiest to use (since it can be font-encoded), but very space-hungry.

2012/4/12 Jan Taks <jan....@smartinstall.nl>


>
> Hello,
>
> We are using the zxing barcode scanner in an Android app to scan 1d barcodes from smart electricity meters. There seems to be some kind of maximum size limit. I am trying to scan this barcode but it is not recognized (using a 5MP camera):
>
> http://www.barcodesinc.com/generator/image.php?code=K86T00002283671&style=196&type=C39&width=600&height=100&xres=3&font=5
>
>

knappador

unread,
Jul 25, 2012, 4:56:36 PM7/25/12
to zx...@googlegroups.com
I reproduced this problem in the following way:
Set camera preview resolution to photo quality.  Back away from 12 digit code to lower effective pixel density.  Barcode read just fine all the way out to half the camera view.
Use same settings on barcode of 15 digits in length.  Barcode never scans.

knappador

unread,
Jul 25, 2012, 6:16:00 PM7/25/12
to zx...@googlegroups.com
The zxing APK can't scan the barcodes that Jan Taks posted.   However, VIN's are scanning just fine using the phone gap plugin after setting camera preview quality to photo.  Results are basically snappy and accurate on iPhone4 at that quality level.

Sean Owen

unread,
Jul 25, 2012, 6:19:40 PM7/25/12
to zx...@googlegroups.com
I looked again at your examples. The first one, the longer one, is corrupt, because part of it is chopped off at the left. Ask the renderer for more width and it also works fine: http://www.barcodesinc.com/generator/image.php?code=K86T00002283671&style=196&type=C39&width=800&height=100&xres=3&font=5

There is no limit in the decoder.
Reply all
Reply to author
Forward
0 new messages