Issue 820 second format info was read incorrectly

git-svn-id: https://zxing.googlecode.com/svn/trunk@1751 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-04-29 08:35:13 +00:00
parent 8092a77e07
commit 2e4e0d0c77
6 changed files with 11 additions and 9 deletions

View file

@ -70,13 +70,13 @@ final class BitMatrixParser {
// Read the top-right/bottom-left pattern too
int dimension = bitMatrix.getHeight();
int formatInfoBits2 = 0;
int iMin = dimension - 8;
for (int i = dimension - 1; i >= iMin; i--) {
formatInfoBits2 = copyBit(i, 8, formatInfoBits2);
}
for (int j = dimension - 7; j < dimension; j++) {
int jMin = dimension - 7;
for (int j = dimension - 1; j >= jMin; j--) {
formatInfoBits2 = copyBit(8, j, formatInfoBits2);
}
for (int i = dimension - 8; i < dimension; i++) {
formatInfoBits2 = copyBit(i, 8, formatInfoBits2);
}
parsedFormatInfo = FormatInformation.decodeFormatInformation(formatInfoBits1, formatInfoBits2);
if (parsedFormatInfo != null) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1 @@
http://www.google.com/

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1 @@
http://www.google.com/

View file

@ -27,10 +27,10 @@ public final class QRCodeBlackBox2TestCase extends AbstractBlackBoxTestCase {
public QRCodeBlackBox2TestCase() {
super("test/data/blackbox/qrcode-2", new MultiFormatReader(), BarcodeFormat.QR_CODE);
addTest(27, 27, 0.0f);
addTest(27, 27, 90.0f);
addTest(27, 27, 180.0f);
addTest(26, 26, 270.0f);
addTest(29, 29, 0.0f);
addTest(29, 29, 90.0f);
addTest(29, 29, 180.0f);
addTest(28, 28, 270.0f);
}
}