Aztec decoder fix: return to Upper mode after U/S B/S sequence. (#643)

* Update Decoder.java

* Add files via upload

dlusbs.png and dlusbs.txt is a test case for the D/L [digit] U/S B/S sequence, which should end in Upper mode, not Digit mode

* Update number of test cases

* Comment logic of the fix

* Mention fixed issue #642
This commit is contained in:
fgrieu 2016-08-08 10:09:53 +02:00 committed by Sean Owen
parent 61016808da
commit b708f95a87
4 changed files with 10 additions and 5 deletions

View file

@ -131,6 +131,10 @@ public final class Decoder {
String str = getCharacter(shiftTable, code);
if (str.startsWith("CTRL_")) {
// Table changes
// ISO/IEC 24778:2008 prescibes ending a shift sequence in the mode from which it was invoked.
// That's including when that mode is a shift.
// Our test case dlusbs.png for issue #642 exercises that.
latchTable = shiftTable; // Latch the current mode, so as to return to Upper after U/S B/S
shiftTable = getTable(str.charAt(5));
if (str.charAt(6) == 'L') {
latchTable = shiftTable;

View file

@ -26,10 +26,10 @@ public final class AztecBlackBox1TestCase extends AbstractBlackBoxTestCase {
public AztecBlackBox1TestCase() {
super("src/test/resources/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC);
addTest(12, 12, 0.0f);
addTest(12, 12, 90.0f);
addTest(12, 12, 180.0f);
addTest(12, 12, 270.0f);
addTest(13, 13, 0.0f);
addTest(13, 13, 90.0f);
addTest(13, 13, 180.0f);
addTest(13, 13, 270.0f);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

View file

@ -0,0 +1 @@
3333h3i3jITIT