mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
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:
parent
61016808da
commit
b708f95a87
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
BIN
core/src/test/resources/blackbox/aztec-1/dlusbs.png
Normal file
BIN
core/src/test/resources/blackbox/aztec-1/dlusbs.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 245 B |
1
core/src/test/resources/blackbox/aztec-1/dlusbs.txt
Normal file
1
core/src/test/resources/blackbox/aztec-1/dlusbs.txt
Normal file
|
@ -0,0 +1 @@
|
|||
3333h3i3jITIT
|
Loading…
Reference in a new issue