diff --git a/core/src/com/google/zxing/oned/AbstractUPCEANReader.java b/core/src/com/google/zxing/oned/AbstractUPCEANReader.java index f971a628e..e90066813 100644 --- a/core/src/com/google/zxing/oned/AbstractUPCEANReader.java +++ b/core/src/com/google/zxing/oned/AbstractUPCEANReader.java @@ -94,7 +94,7 @@ public abstract class AbstractUPCEANReader extends AbstractOneDReader implements nextStart = startRange[1]; // As a check, we want to see some white in front of this "start pattern", // maybe as wide as the start pattern itself? - foundStart = row.isRange(Math.max(0, start - 2 * (startRange[1] - start)), start, false); + foundStart = row.isRange(Math.max(0, start - (3 * (startRange[1] - start)) / 2), start, false); } return startRange; } @@ -110,7 +110,7 @@ public abstract class AbstractUPCEANReader extends AbstractOneDReader implements // Check for whitespace after the pattern int end = endRange[1]; - if (!row.isRange(end, Math.min(row.getSize(), end + 2 * (end - endRange[0])), false)) { + if (!row.isRange(end, Math.min(row.getSize(), end + (3 * (end - endRange[0])) / 2), false)) { throw new ReaderException("Pattern not followed by whitespace"); } diff --git a/core/test/src/com/google/zxing/negative/FalsePositivesBlackBoxTestCase.java b/core/test/src/com/google/zxing/negative/FalsePositivesBlackBoxTestCase.java index f07348ec2..4e39d0140 100644 --- a/core/test/src/com/google/zxing/negative/FalsePositivesBlackBoxTestCase.java +++ b/core/test/src/com/google/zxing/negative/FalsePositivesBlackBoxTestCase.java @@ -31,7 +31,7 @@ public final class FalsePositivesBlackBoxTestCase extends AbstractNegativeBlackB super(new File("test/data/blackbox/falsepositives")); addTest(1, 0.0f); addTest(1, 90.0f); - addTest(1, 180.0f); + addTest(2, 180.0f); addTest(0, 270.0f); } diff --git a/core/test/src/com/google/zxing/oned/EAN13BlackBox1TestCase.java b/core/test/src/com/google/zxing/oned/EAN13BlackBox1TestCase.java index 1113c16aa..f19ecfd68 100644 --- a/core/test/src/com/google/zxing/oned/EAN13BlackBox1TestCase.java +++ b/core/test/src/com/google/zxing/oned/EAN13BlackBox1TestCase.java @@ -29,8 +29,8 @@ public final class EAN13BlackBox1TestCase extends AbstractBlackBoxTestCase { public EAN13BlackBox1TestCase() { super(new File("test/data/blackbox/ean13-1"), new MultiFormatReader(), BarcodeFormat.EAN_13); - addTest(26, 29, 0.0f); - addTest(24, 29, 180.0f); + addTest(27, 29, 0.0f); + addTest(25, 29, 180.0f); } } \ No newline at end of file diff --git a/core/test/src/com/google/zxing/oned/UPCEBlackBox2TestCase.java b/core/test/src/com/google/zxing/oned/UPCEBlackBox2TestCase.java index 54f7606b8..7c9673734 100644 --- a/core/test/src/com/google/zxing/oned/UPCEBlackBox2TestCase.java +++ b/core/test/src/com/google/zxing/oned/UPCEBlackBox2TestCase.java @@ -29,8 +29,8 @@ public final class UPCEBlackBox2TestCase extends AbstractBlackBoxTestCase { public UPCEBlackBox2TestCase() { super(new File("test/data/blackbox/upce-2"), new MultiFormatReader(), BarcodeFormat.UPC_E); - addTest(17, 28, 0.0f); - addTest(19, 28, 180.0f); + addTest(24, 34, 0.0f); + addTest(26, 34, 180.0f); } }