diff --git a/core/src/com/google/zxing/aztec/decoder/Decoder.java b/core/src/com/google/zxing/aztec/decoder/Decoder.java index 298853434..e743eff1c 100644 --- a/core/src/com/google/zxing/aztec/decoder/Decoder.java +++ b/core/src/com/google/zxing/aztec/decoder/Decoder.java @@ -85,6 +85,7 @@ public final class Decoder { private int numCodewords; private int codewordSize; private AztecDetectorResult ddata; + private int invertedBitCount; public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException { ddata = detectorResult; @@ -113,7 +114,7 @@ public final class Decoder { */ private String getEncodedData(boolean[] correctedBits) throws FormatException { - int endIndex = codewordSize * ddata.getNbDatablocks(); + int endIndex = codewordSize * ddata.getNbDatablocks() - invertedBitCount; if (endIndex > correctedBits.length) { throw FormatException.getFormatInstance(); } @@ -303,6 +304,7 @@ public final class Decoder { } offset = 0; + invertedBitCount = 0; boolean[] correctedBits = new boolean[numDataCodewords*codewordSize]; for (int i = 0; i < numDataCodewords; i ++) { @@ -325,6 +327,7 @@ public final class Decoder { seriesColor = false; seriesCount = 0; offset++; + invertedBitCount++; } else { if (seriesColor == color) { diff --git a/core/test/data/blackbox/aztec-1/7.png b/core/test/data/blackbox/aztec-1/7.png new file mode 100644 index 000000000..e42dbacfb Binary files /dev/null and b/core/test/data/blackbox/aztec-1/7.png differ diff --git a/core/test/data/blackbox/aztec-1/7.txt b/core/test/data/blackbox/aztec-1/7.txt new file mode 100644 index 000000000..b83fc506d --- /dev/null +++ b/core/test/data/blackbox/aztec-1/7.txt @@ -0,0 +1 @@ +Code 2D! \ No newline at end of file diff --git a/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java b/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java index 6e5325f4c..367625ece 100644 --- a/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java +++ b/core/test/src/com/google/zxing/aztec/AztecBlackBox1TestCase.java @@ -26,10 +26,10 @@ public final class AztecBlackBox1TestCase extends AbstractBlackBoxTestCase { public AztecBlackBox1TestCase() { super("test/data/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC); - addTest(6, 6, 0.0f); - addTest(6, 6, 90.0f); - addTest(6, 6, 180.0f); - addTest(6, 6, 270.0f); + addTest(7, 7, 0.0f); + addTest(7, 7, 90.0f); + addTest(7, 7, 180.0f); + addTest(7, 7, 270.0f); } } \ No newline at end of file