Fixed the upper limit of ECI values to be more permissive according to the spec, in almost all language versions except C.

pull/16/head
Project Nayuki 7 years ago
parent 58a39a96c3
commit 6b2cfd98dc

@ -137,7 +137,7 @@ QrSegment QrSegment::makeEci(long assignVal) {
else if ((1 << 7) <= assignVal && assignVal < (1 << 14)) {
bb.appendBits(2, 2);
bb.appendBits(assignVal, 14);
} else if ((1 << 14) <= assignVal && assignVal < 999999L) {
} else if ((1 << 14) <= assignVal && assignVal < 1000000L) {
bb.appendBits(6, 3);
bb.appendBits(assignVal, 21);
} else

@ -143,7 +143,7 @@ public final class QrSegment {
else if ((1 << 7) <= assignVal && assignVal < (1 << 14)) {
bb.appendBits(2, 2);
bb.appendBits(assignVal, 14);
} else if ((1 << 14) <= assignVal && assignVal < 999999) {
} else if ((1 << 14) <= assignVal && assignVal < 1000000) {
bb.appendBits(6, 3);
bb.appendBits(assignVal, 21);
} else

@ -829,7 +829,7 @@ var qrcodegen = new function() {
else if ((1 << 7) <= assignVal && assignVal < (1 << 14)) {
bb.appendBits(2, 2);
bb.appendBits(assignVal, 14);
} else if ((1 << 14) <= assignVal && assignVal < 999999) {
} else if ((1 << 14) <= assignVal && assignVal < 1000000) {
bb.appendBits(6, 3);
bb.appendBits(assignVal, 21);
} else

@ -681,7 +681,7 @@ class QrSegment(object):
elif (1 << 7) <= assignval < (1 << 14):
bb.append_bits(2, 2)
bb.append_bits(assignval, 14)
elif (1 << 14) <= assignval < 999999:
elif (1 << 14) <= assignval < 1000000:
bb.append_bits(6, 3)
bb.append_bits(assignval, 21)
else:

Loading…
Cancel
Save