mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Little bug fix affecting QR Codes that run all the way to the left/top edge of an image
git-svn-id: https://zxing.googlecode.com/svn/trunk@215 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
82bc8e437a
commit
4525328e45
|
@ -178,13 +178,15 @@ public final class Detector {
|
||||||
// Now count other way -- don't run off image though of course
|
// Now count other way -- don't run off image though of course
|
||||||
int otherToX = fromX - (toX - fromX);
|
int otherToX = fromX - (toX - fromX);
|
||||||
if (otherToX < 0) {
|
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()) {
|
} else if (otherToX >= image.getWidth()) {
|
||||||
otherToX = image.getWidth();
|
otherToX = image.getWidth();
|
||||||
}
|
}
|
||||||
int otherToY = fromY - (toY - fromY);
|
int otherToY = fromY - (toY - fromY);
|
||||||
if (otherToY < 0) {
|
if (otherToY < 0) {
|
||||||
otherToY = 0;
|
otherToY = -1;
|
||||||
} else if (otherToY >= image.getHeight()) {
|
} else if (otherToY >= image.getHeight()) {
|
||||||
otherToY = image.getHeight();
|
otherToY = image.getHeight();
|
||||||
}
|
}
|
||||||
|
|
12
core/test/data/blackbox/qrcode-2/11.txt
Normal file
12
core/test/data/blackbox/qrcode-2/11.txt
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
BEGIN:VCARD
|
||||||
|
N:Kennedy;Steve
|
||||||
|
TEL:+44 (0)7775 755503
|
||||||
|
ADR;HOME:;;Flat 2, 43 Howitt Road, Belsize Park;London;;NW34LU;UK
|
||||||
|
ORG:NetTek Ltd;
|
||||||
|
TITLE:Consultant
|
||||||
|
EMAIL:steve@nettek.co.uk
|
||||||
|
URL:www.nettek.co.uk
|
||||||
|
EMAIL;IM:MSN:steve@gbnet.net
|
||||||
|
NOTE:Testing 1 2 3
|
||||||
|
BDAY:19611105
|
||||||
|
END:VCARD
|
1
core/test/data/blackbox/qrcode-2/11.url
Normal file
1
core/test/data/blackbox/qrcode-2/11.url
Normal file
|
@ -0,0 +1 @@
|
||||||
|
http://www.d-co.de/images/qrcode_eg1.gif
|
Loading…
Reference in a new issue