diff --git a/core/src/com/google/zxing/datamatrix/DataMatrixReader.java b/core/src/com/google/zxing/datamatrix/DataMatrixReader.java index c3a940800..f66be4af3 100644 --- a/core/src/com/google/zxing/datamatrix/DataMatrixReader.java +++ b/core/src/com/google/zxing/datamatrix/DataMatrixReader.java @@ -97,7 +97,6 @@ public final class DataMatrixReader implements Reader { * around it. This is a specialized method that works exceptionally fast in this special * case. * - * @see com.google.zxing.pdf417.PDF417Reader#extractPureBits(BitMatrix) * @see com.google.zxing.qrcode.QRCodeReader#extractPureBits(BitMatrix) */ private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException { diff --git a/core/src/com/google/zxing/maxicode/MaxiCodeReader.java b/core/src/com/google/zxing/maxicode/MaxiCodeReader.java index 48b13b6c3..0ff6f42ca 100644 --- a/core/src/com/google/zxing/maxicode/MaxiCodeReader.java +++ b/core/src/com/google/zxing/maxicode/MaxiCodeReader.java @@ -92,7 +92,6 @@ public final class MaxiCodeReader implements Reader { * around it. This is a specialized method that works exceptionally fast in this special * case. * - * @see com.google.zxing.pdf417.PDF417Reader#extractPureBits(BitMatrix) * @see com.google.zxing.datamatrix.DataMatrixReader#extractPureBits(BitMatrix) * @see com.google.zxing.qrcode.QRCodeReader#extractPureBits(BitMatrix) */ diff --git a/core/src/com/google/zxing/qrcode/QRCodeReader.java b/core/src/com/google/zxing/qrcode/QRCodeReader.java index a073b2612..819ba85be 100644 --- a/core/src/com/google/zxing/qrcode/QRCodeReader.java +++ b/core/src/com/google/zxing/qrcode/QRCodeReader.java @@ -101,7 +101,6 @@ public class QRCodeReader implements Reader { * around it. This is a specialized method that works exceptionally fast in this special * case. * - * @see com.google.zxing.pdf417.PDF417Reader#extractPureBits(BitMatrix) * @see com.google.zxing.datamatrix.DataMatrixReader#extractPureBits(BitMatrix) */ private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException { @@ -146,6 +145,16 @@ public class QRCodeReader implements Reader { int nudge = (int) (moduleSize / 2.0f); top += nudge; left += nudge; + + // But careful that this does not sample off the edge + int nudgedTooFarRight = left + (int) ((matrixWidth - 1) * moduleSize) - (right - 1); + if (nudgedTooFarRight > 0) { + left -= nudgedTooFarRight; + } + int nudgedTooFarDown = top + (int) ((matrixHeight - 1) * moduleSize) - (bottom - 1); + if (nudgedTooFarDown > 0) { + top -= nudgedTooFarDown; + } // Now just read off the bits BitMatrix bits = new BitMatrix(matrixWidth, matrixHeight);