mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 13:04:05 -08:00
Changed the parsing logic to refer to EAN-8 and EAN-13 as UPCs as well, so that the clients can recognize them as product barcodes and offer to do a product search.
git-svn-id: https://zxing.googlecode.com/svn/trunk@366 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
cd7c4d21ac
commit
a816d5d9b1
|
@ -31,9 +31,11 @@ public final class UPCParsedResult extends ParsedReaderResult {
|
|||
this.upc = upc;
|
||||
}
|
||||
|
||||
// Treat all UPC and EAN variants as UPCs, in the sense that they are all product barcodes.
|
||||
public static UPCParsedResult parse(Result result) {
|
||||
BarcodeFormat format = result.getBarcodeFormat();
|
||||
if (!BarcodeFormat.UPC_A.equals(format) && !BarcodeFormat.UPC_E.equals(format)) {
|
||||
if (!BarcodeFormat.UPC_A.equals(format) && !BarcodeFormat.UPC_E.equals(format) &&
|
||||
!BarcodeFormat.EAN_8.equals(format) && !BarcodeFormat.EAN_13.equals(format)) {
|
||||
return null;
|
||||
}
|
||||
String rawText = result.getText();
|
||||
|
|
Loading…
Reference in a new issue