Marginal improvement to datamatrix decoder
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 11 May 2009 21:02:08 +0000 (21:02 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Mon, 11 May 2009 21:02:08 +0000 (21:02 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@937 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/datamatrix/detector/Detector.java

index 8649a65..eed0dfd 100644 (file)
@@ -147,6 +147,10 @@ public final class Detector {
 
     int dimension = Math.min(transitionsBetween(topLeft, topRight).getTransitions(), 
                              transitionsBetween(bottomRight, topRight).getTransitions());
+    if ((dimension & 0x01) == 1) {
+      // it can't be odd, so, round... up?
+      dimension++;
+    }
     dimension += 2;
 
     BitMatrix bits = sampleGrid(image, topLeft, bottomLeft, bottomRight, dimension);