If the decoded text is of type EAN_13 or UPC_A, remove the first character as it exists twice. Fixes #110

This commit is contained in:
Nikos Ftylitakis 2019-06-21 15:58:25 +03:00
parent 9eac8518ac
commit c5bb5f2730
1 changed files with 2 additions and 1 deletions

View File

@ -92,7 +92,8 @@ Ref<Result> MultiFormatUPCEANReader::decodeRow(int rowNumber, Ref<BitArray> row,
// here, and convert an EAN-13 result to a UPC-A result if // here, and convert an EAN-13 result to a UPC-A result if
// appropriate. // appropriate.
bool ean13MayBeUPCA = bool ean13MayBeUPCA =
result->getBarcodeFormat() == BarcodeFormat::EAN_13 && (result->getBarcodeFormat() == BarcodeFormat::UPC_A ||
result->getBarcodeFormat() == BarcodeFormat::EAN_13) &&
result->getText()->charAt(0) == '0'; result->getText()->charAt(0) == '0';
// Note: doesn't match Java which uses hints // Note: doesn't match Java which uses hints