mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -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;
|
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) {
|
public static UPCParsedResult parse(Result result) {
|
||||||
BarcodeFormat format = result.getBarcodeFormat();
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
String rawText = result.getText();
|
String rawText = result.getText();
|
||||||
|
|
Loading…
Reference in a new issue