mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
C++ port: UPCEAN reader fixes
- make UPCEANReader fail if there's no quiet zone after the end marker, vastly reducing UPC_E false positives git-svn-id: https://zxing.googlecode.com/svn/trunk@1495 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
52f0822076
commit
2cd81bae2a
|
@ -113,14 +113,13 @@ namespace zxing {
|
|||
|
||||
int* endRange = decodeEnd(row, endStart);
|
||||
|
||||
#pragma mark QuietZone needs some change
|
||||
// Make sure there is a quiet zone at least as big as the end pattern after the barcode. The
|
||||
// spec might want more whitespace, but in practice this is the maximum we can count on.
|
||||
// int end = endRange[1];
|
||||
// int quietEnd = end + (end - endRange[0]);
|
||||
// if (quietEnd >= row->getSize() || !row->isRange(end, quietEnd, false)) {
|
||||
// throw ReaderException("Quiet zone asserrt fail.");
|
||||
// }
|
||||
size_t end = endRange[1];
|
||||
size_t quietEnd = end + (end - endRange[0]);
|
||||
if (quietEnd >= row->getSize() || !row->isRange(end, quietEnd, false)) {
|
||||
throw ReaderException("Quiet zone asserrt fail.");
|
||||
}
|
||||
|
||||
if (!checkChecksum(tmpResultString)) {
|
||||
if (startGuardRange!=NULL) {
|
||||
|
|
Loading…
Reference in a new issue