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:
dswitkin 2008-04-18 14:30:02 +00:00
parent cd7c4d21ac
commit a816d5d9b1

View file

@ -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();