From c5bb5f273028f3c3e6f643a37a6a70ed77853240 Mon Sep 17 00:00:00 2001 From: Nikos Ftylitakis Date: Fri, 21 Jun 2019 15:58:25 +0300 Subject: [PATCH] If the decoded text is of type EAN_13 or UPC_A, remove the first character as it exists twice. Fixes #110 --- src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp b/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp index fbff86b..330c218 100644 --- a/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp +++ b/src/zxing/zxing/oned/MultiFormatUPCEANReader.cpp @@ -92,7 +92,8 @@ Ref MultiFormatUPCEANReader::decodeRow(int rowNumber, Ref row, // here, and convert an EAN-13 result to a UPC-A result if // appropriate. bool ean13MayBeUPCA = - result->getBarcodeFormat() == BarcodeFormat::EAN_13 && + (result->getBarcodeFormat() == BarcodeFormat::UPC_A || + result->getBarcodeFormat() == BarcodeFormat::EAN_13) && result->getText()->charAt(0) == '0'; // Note: doesn't match Java which uses hints