C++ port: UPCEAN reader fixes
authorflyashi <flyashi@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 29 Jul 2010 18:52:24 +0000 (18:52 +0000)
committerflyashi <flyashi@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 29 Jul 2010 18:52:24 +0000 (18:52 +0000)
 - make UPCEANReader fail if there's no quiet zone after the end marker, vastly reducing UPC_E false positives

git-svn-id: http://zxing.googlecode.com/svn/trunk@1495 59b500cc-1b3d-0410-9834-0bbf25fbcc57

cpp/core/src/zxing/oned/UPCEANReader.cpp

index e0154c5..ef143b8 100644 (file)
@@ -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) {