diff --git a/core/src/main/java/com/google/zxing/aztec/detector/Detector.java b/core/src/main/java/com/google/zxing/aztec/detector/Detector.java index 6ce7c5523..ef964ee09 100644 --- a/core/src/main/java/com/google/zxing/aztec/detector/Detector.java +++ b/core/src/main/java/com/google/zxing/aztec/detector/Detector.java @@ -566,10 +566,7 @@ public final class Detector { if (compact) { return 4 * nbLayers + 11; } - if (nbLayers <= 4) { - return 4 * nbLayers + 15; - } - return 4 * nbLayers + 2 * ((nbLayers - 4) / 8 + 1) + 15; + return 4 * nbLayers + 2 * ((2 * nbLayers + 6) / 15) + 15; } static final class Point { diff --git a/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java b/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java index 18c822f52..029abf2cb 100644 --- a/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java +++ b/core/src/test/java/com/google/zxing/aztec/AztecBlackBox1TestCase.java @@ -26,10 +26,10 @@ public final class AztecBlackBox1TestCase extends AbstractBlackBoxTestCase { public AztecBlackBox1TestCase() { super("src/test/resources/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC); - addTest(13, 13, 0.0f); - addTest(13, 13, 90.0f); - addTest(13, 13, 180.0f); - addTest(13, 13, 270.0f); + addTest(14, 14, 0.0f); + addTest(14, 14, 90.0f); + addTest(14, 14, 180.0f); + addTest(14, 14, 270.0f); } } diff --git a/core/src/test/resources/blackbox/aztec-1/lorem-131x131.png b/core/src/test/resources/blackbox/aztec-1/lorem-131x131.png new file mode 100644 index 000000000..518d48f8d Binary files /dev/null and b/core/src/test/resources/blackbox/aztec-1/lorem-131x131.png differ diff --git a/core/src/test/resources/blackbox/aztec-1/lorem-131x131.txt b/core/src/test/resources/blackbox/aztec-1/lorem-131x131.txt new file mode 100644 index 000000000..4acef72c1 --- /dev/null +++ b/core/src/test/resources/blackbox/aztec-1/lorem-131x131.txt @@ -0,0 +1 @@ +In ut magna vel mauris malesuada dictum. Nulla ullamcorper metus quis diam cursus facilisis. Sed mollis quam id justo rutrum sagittis. Donec laoreet rutrum est, nec convallis mauris condimentum sit amet. Phasellus gravida, justo et congue auctor, nisi ipsum viverra erat, eget hendrerit felis turpis nec lorem. Nulla ultrices, elit pellentesque aliquet laoreet, justo erat pulvinar nisi, id elementum sapien dolor et diam. Donec ac nunc sodales elit placerat eleifend. Sed ornare luctus ornare. Vestibulum vehicula, massa at pharetra fringilla, risus justo faucibus erat, nec porttitor nibh tellus sed est. Ut justo diam, lobortis eu tristique ac, p.In ut magna vel mauris malesuada dictum. Nulla ullamcorper metus quis diam cursus facilisis. Sed mollis quam id justo rutrum sagittis. Donec laoreet rutrum est, nec convallis mauris condimentum sit amet. Phasellus gravida, justo et congue auctor, nisi ipsum viverra erat, eget hendrerit felis turpis nec lorem. Nulla ultrices, elit pellentesque aliquet laoreet, justo erat pulvinar nisi, id elementum sapien dolor et diam. Donec ac nunc sodales elit placerat eleifend. Sed ornare luctus ornare. Vestibulum vehicula, massa at pharetra fringilla, risus justo faucibus erat, nec porttitor nibh tellus sed est. Ut justo diam, lobortis eu tristique ac, p. In ut magna vel mauris malesuada dictum. Nulla ullamcorper metus quis diam cursus facilisis. Sed mollis quam id justo rutrum sagittis. Donec laoreet rutrum est, nec convallis mauris condimentum sit amet. Phasellus gravida, justo et congue auctor, nisi ipsum viverra erat, eget hendrerit felis turpis nec lorem. Nulla ultrices, elit pellentesque aliquet laoreet, justo erat pulvinar nisi, id elementum sapien dolor et diam. Donec ac nunc sodales elit placerat eleifend. Sed ornare luctus ornare. Vestibulum vehicula, massa at pharetra fringilla, risus justo faucibus erat, nec porttitor nibh tellus sed est. Ut justo diam, lobortis eu tristique ac, p.In ut magna vel mauris malesuada dictum. Nulla ullamcorper metus quis diam cursus facilisis. Sed mollis quam id justo rutrum sagittis. Donec laoreet rutrum est, nec convallis mauris condimentum sit amet. Phasellus gravida, justo et congue auctor, nisi ipsum viverra erat, eget hendrerit felis turpis nec lorem. Nulla ultrices, elit pellentesque aliquet laoreet, justo erat pulvinar nisi, id elementum sapien dolor et diam. Donec ac nunc sodales elit placerat eleifend. Sed ornare luctus ornare. Vestibulum vehicula, massa at pharetra fringilla, risus justo faucibus erat, nec porttitor nibh tellus sed est. Ut justo diam, lobortis eu tris. In ut magna vel mauris malesuada dictum. Nulla ullamcorper metus quis diam cursus facilisis. Sed mollis quam id justo rutrum sagittis. Donec laoreet rutrum est, nec convallis mauris condimentum sit amet. Phasellus gravida, justo e. \ No newline at end of file