mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
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:
parent
eda536772b
commit
8d594c783d
|
@ -115,6 +115,12 @@ public class QRCodeReader implements Reader {
|
|||
int bottom = rightBottomBlack[1];
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue