mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -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;
|
left += nudge;
|
||||||
|
|
||||||
// But careful that this does not sample off the edge
|
// 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 > 0) {
|
||||||
if (nudgedTooFarRight > nudge) {
|
if (nudgedTooFarRight > nudge) {
|
||||||
// Neither way fits; abort
|
// Neither way fits; abort
|
||||||
|
@ -167,7 +169,8 @@ public class QRCodeReader implements Reader {
|
||||||
}
|
}
|
||||||
left -= nudgedTooFarRight;
|
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 > 0) {
|
||||||
if (nudgedTooFarDown > nudge) {
|
if (nudgedTooFarDown > nudge) {
|
||||||
// Neither way fits; abort
|
// Neither way fits; abort
|
||||||
|
|
Loading…
Reference in a new issue