Issue 1002 handle case where pure QR code's bottom right module isn't black

git-svn-id: https://zxing.googlecode.com/svn/trunk@1946 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-09-29 14:51:20 +00:00
parent eda536772b
commit 8d594c783d

View file

@ -116,6 +116,12 @@ public class QRCodeReader implements Reader {
int left = leftTopBlack[0];
int right = rightBottomBlack[0];
if (bottom - top != right - left) {
// Special case, where bottom-right module wasn't black so we found something else in the last row
// Assume it's a square, so use height as the width
right = left + (bottom - top);
}
int matrixWidth = (right - left + 1) / moduleSize;
int matrixHeight = (bottom - top + 1) / moduleSize;
if (matrixWidth <= 0 || matrixHeight <= 0) {