X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fqrcode%2FQRCodeReader.java;h=a8252301c08ec6960db10cb3127db52606a9a91f;hb=855803a452210f862347d24bbdbaf5a2efe92f33;hp=3bef7aa679751f24004089356d972af6ee26861c;hpb=67bb87dea0eb848f80814f0353196079023a7aaf;p=zxing.git diff --git a/core/src/com/google/zxing/qrcode/QRCodeReader.java b/core/src/com/google/zxing/qrcode/QRCodeReader.java index 3bef7aa6..a8252301 100644 --- a/core/src/com/google/zxing/qrcode/QRCodeReader.java +++ b/core/src/com/google/zxing/qrcode/QRCodeReader.java @@ -93,7 +93,7 @@ public final class QRCodeReader implements Reader { borderWidth++; } if (borderWidth == minDimension) { - throw new ReaderException("No black pixels found along diagonal"); + throw ReaderException.getInstance(); } // And then keep tracking across the top-left black module to determine module size @@ -102,7 +102,7 @@ public final class QRCodeReader implements Reader { moduleEnd++; } if (moduleEnd == minDimension) { - throw new ReaderException("No end to black pixels found along diagonal"); + throw ReaderException.getInstance(); } int moduleSize = moduleEnd - borderWidth; @@ -113,14 +113,13 @@ public final class QRCodeReader implements Reader { rowEndOfSymbol--; } if (rowEndOfSymbol < 0) { - throw new ReaderException("Can't find end of rightmost black module"); + throw ReaderException.getInstance(); } rowEndOfSymbol++; // Make sure width of barcode is a multiple of module size if ((rowEndOfSymbol - borderWidth) % moduleSize != 0) { - throw new ReaderException("Bad module size / width: " + moduleSize + - " / " + (rowEndOfSymbol - borderWidth)); + throw ReaderException.getInstance(); } int dimension = (rowEndOfSymbol - borderWidth) / moduleSize; @@ -131,7 +130,7 @@ public final class QRCodeReader implements Reader { int sampleDimension = borderWidth + (dimension - 1) * moduleSize; if (sampleDimension >= width || sampleDimension >= height) { - throw new ReaderException("Estimated pure image size is beyond image boundaries"); + throw ReaderException.getInstance(); } // Now just read off the bits