[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809

srowen srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:32:32 UTC 2010


The following commit has been merged in the upstream branch:
commit 4850a108ddd277ae9e4e8cc1806c3f928f1d0776
Author: srowen <srowen at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date:   Wed Jul 14 20:49:13 2010 +0000

    Fix corner case - pure barcode, 1 pixel module
    
    git-svn-id: http://zxing.googlecode.com/svn/trunk@1483 59b500cc-1b3d-0410-9834-0bbf25fbcc57

diff --git a/core/src/com/google/zxing/qrcode/QRCodeReader.java b/core/src/com/google/zxing/qrcode/QRCodeReader.java
index 33c50b8..2a12c6d 100644
--- a/core/src/com/google/zxing/qrcode/QRCodeReader.java
+++ b/core/src/com/google/zxing/qrcode/QRCodeReader.java
@@ -140,9 +140,10 @@ public class QRCodeReader implements Reader {
 
     // Push in the "border" by half the module width so that we start
     // sampling in the middle of the module. Just in case the image is a
-    // little off, this will help recover.
-    x -= moduleSize >> 1;
-    y -= moduleSize >> 1;
+    // little off, this will help recover. Need to back up at least 1.
+    int backOffAmount = moduleSize == 1 ? 1 : moduleSize >> 1;
+    x -= backOffAmount;
+    y -= backOffAmount;
 
     if ((x + (dimension - 1) * moduleSize) >= width ||
         (y + (dimension - 1) * moduleSize) >= height) {

-- 
Multi-format 1D/2D barcode image processing library



More information about the Pkg-google-commits mailing list