Zxing sometimes picks up the wrong data from barcode

元气小坏坏 提交于 2019-11-30 19:16:25

问题


I know this might be rather a simple issue to ask for and we can also set the barcode format to be scanned by Zxing, like this:

(1)intent.putExtra("SCAN_MODE", "QR_CODE_MODE"); //or any other format

if we do this:

(2)intent.putExtra("SCAN_MODE", "SCAN_MODE"); //for all modes`

While doing the #2 mentioned right above this line, the scanner sometimes seems to scan part of the barcode and picks up wrong information. For example if I try to simply scan a UPC barcode, 98% of the times it works beautifully, but sometimes it just returns me a wrong barcode. I think I know whats happening here, I have an idea up in my head, but what is the exact technical explanation for this? (Anyone familiar with barcodes can help) Thanks in advance guys.


回答1:


SCAN_MODE is not a valid value. It is ignored and you are scanning for all formats.

It is not reading the wrong information from a barcode; it is finding a 'phantom' barcode among all those white and black lines, of another format. The usual culprit is UPC-E, which is the easiest to accidentally see.

This is why it is far better to restrict the scan to the format you are interested in with a correct value of SCAN_MODE.



来源:https://stackoverflow.com/questions/21764803/zxing-sometimes-picks-up-the-wrong-data-from-barcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!