Little bug fix affecting QR Codes that run all the way to the left/top edge of an...
authorsrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Tue, 19 Feb 2008 21:49:26 +0000 (21:49 +0000)
committersrowen <srowen@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Tue, 19 Feb 2008 21:49:26 +0000 (21:49 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@215 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/qrcode/detector/Detector.java
core/test/data/blackbox/qrcode-2/11.txt [new file with mode: 0644]
core/test/data/blackbox/qrcode-2/11.url [new file with mode: 0644]

index 356defa..87a08fb 100644 (file)
@@ -178,13 +178,15 @@ public final class Detector {
     // Now count other way -- don't run off image though of course
     int otherToX = fromX - (toX - fromX);
     if (otherToX < 0) {
-      otherToX = 0;
+      // "to" should the be the first value not included, so, the first value off
+      // the edge is -1
+      otherToX = -1;
     } else if (otherToX >= image.getWidth()) {
       otherToX = image.getWidth();
     }
     int otherToY = fromY - (toY - fromY);
     if (otherToY < 0) {
-      otherToY = 0;
+      otherToY = -1;
     } else if (otherToY >= image.getHeight()) {
       otherToY = image.getHeight();
     }
diff --git a/core/test/data/blackbox/qrcode-2/11.txt b/core/test/data/blackbox/qrcode-2/11.txt
new file mode 100644 (file)
index 0000000..2b574b7
--- /dev/null
@@ -0,0 +1,12 @@
+BEGIN:VCARD\r
+N:Kennedy;Steve\r
+TEL:+44 (0)7775 755503\r
+ADR;HOME:;;Flat 2, 43 Howitt Road, Belsize Park;London;;NW34LU;UK\r
+ORG:NetTek Ltd;\r
+TITLE:Consultant\r
+EMAIL:steve@nettek.co.uk\r
+URL:www.nettek.co.uk\r
+EMAIL;IM:MSN:steve@gbnet.net\r
+NOTE:Testing 1 2 3\r
+BDAY:19611105\r
+END:VCARD
\ No newline at end of file
diff --git a/core/test/data/blackbox/qrcode-2/11.url b/core/test/data/blackbox/qrcode-2/11.url
new file mode 100644 (file)
index 0000000..5ea8885
--- /dev/null
@@ -0,0 +1 @@
+http://www.d-co.de/images/qrcode_eg1.gif
\ No newline at end of file