mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Closes issue #162 : PURE_BARCODE fails on certain dense QR codes
This commit is contained in:
parent
1fa62635de
commit
84643199a9
|
@ -159,7 +159,9 @@ public class QRCodeReader implements Reader {
|
|||
left += nudge;
|
||||
|
||||
// But careful that this does not sample off the edge
|
||||
int nudgedTooFarRight = left + (int) ((matrixWidth - 1) * moduleSize) - (right - 1);
|
||||
// "right" is the farthest-right valid pixel location -- right+1 is not necessarily
|
||||
// This is positive by how much the inner x loop below would be too large
|
||||
int nudgedTooFarRight = left + (int) ((matrixWidth - 1) * moduleSize) - right;
|
||||
if (nudgedTooFarRight > 0) {
|
||||
if (nudgedTooFarRight > nudge) {
|
||||
// Neither way fits; abort
|
||||
|
@ -167,7 +169,8 @@ public class QRCodeReader implements Reader {
|
|||
}
|
||||
left -= nudgedTooFarRight;
|
||||
}
|
||||
int nudgedTooFarDown = top + (int) ((matrixHeight - 1) * moduleSize) - (bottom - 1);
|
||||
// See logic above
|
||||
int nudgedTooFarDown = top + (int) ((matrixHeight - 1) * moduleSize) - bottom;
|
||||
if (nudgedTooFarDown > 0) {
|
||||
if (nudgedTooFarDown > nudge) {
|
||||
// Neither way fits; abort
|
||||
|
|
Loading…
Reference in a new issue