简体   繁体   中英

ZXing Android Studio barcode scanner not working with large barcodes

I have developed an app for reading bar codes using the ZXing library, it works without problems with short codes such as:

Short Bar Code

在此处输入图片说明

but with long codes like the following, the program simply can not get any reading:

Long Bar Code

在此处输入图片说明

Any ideas on how to solve this? I need to read longer bar codes

I don't think the problem lies with ZXing .

As the barcode given in the question is a Code 128 format, which is supported by ZXing and the image attached in question is successfully scanned by ZXing Online Decoder and the output of scanned image is as:

+--------------------+----------------------------+
| Raw text           | DSEC3743T0040001P96837678  |
+--------------------+----------------------------+
| Raw bytes          | 68 24 33 25 23 63 25 2b    |
|                    | 64 34 10 63 04 00 01 64    |
|                    | 30 63 60 53 4c 4e 54 6a    |
+--------------------+----------------------------+
| Barcode format     | CODE_128                   |
+--------------------+----------------------------+
| Parsed Result Type | TEXT                       |
+--------------------+----------------------------+
| Parsed Result      | DSEC3743T0040001P96837678  |
+--------------------+----------------------------+

The image is too long to be scanned properly by certain phone's camera, as ZXing receives callbacks from screen while camera is on so make sure barcode is properly focused and camera is not that shaky.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM