mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
several backported fixes (some are not supported and are not included in tests)
This commit is contained in:
@@ -106,9 +106,7 @@ impl ECIStringBuilder {
|
|||||||
pub fn appendECI(&mut self, value: u32) -> Result<(), Exceptions> {
|
pub fn appendECI(&mut self, value: u32) -> Result<(), Exceptions> {
|
||||||
self.encodeCurrentBytesIfAny();
|
self.encodeCurrentBytesIfAny();
|
||||||
let character_set_eci = CharacterSetECI::getCharacterSetECIByValue(value)?;
|
let character_set_eci = CharacterSetECI::getCharacterSetECIByValue(value)?;
|
||||||
// if (character_set_eci == null) {
|
|
||||||
// throw FormatException.getFormatInstance();
|
|
||||||
// }
|
|
||||||
self.current_charset = CharacterSetECI::getCharset(&character_set_eci);
|
self.current_charset = CharacterSetECI::getCharset(&character_set_eci);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -688,7 +688,7 @@ fn decodeECISegment(bits: &mut BitSource, result: &mut ECIStringBuilder) -> Resu
|
|||||||
|
|
||||||
let secondByte = bits.readBits(8)?;
|
let secondByte = bits.readBits(8)?;
|
||||||
if firstByte <= 191 {
|
if firstByte <= 191 {
|
||||||
return result.appendECI(firstByte - 1);
|
return result.appendECI((firstByte - 128) * 254 + 127 + secondByte - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let thirdByte = bits.readBits(8)?;
|
let thirdByte = bits.readBits(8)?;
|
||||||
|
|||||||
BIN
test_resources/blackbox/datamatrix-1/readerinit.png
Normal file
BIN
test_resources/blackbox/datamatrix-1/readerinit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 132 B |
@@ -0,0 +1,2 @@
|
|||||||
|
symbologyIdentifier=]d1
|
||||||
|
readerInit=true
|
||||||
1
test_resources/blackbox/datamatrix-1/readerinit.txt
Normal file
1
test_resources/blackbox/datamatrix-1/readerinit.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
$I
|
||||||
@@ -29,10 +29,10 @@ fn data_matrix_black_box1_test_case() {
|
|||||||
rxing::BarcodeFormat::DATA_MATRIX,
|
rxing::BarcodeFormat::DATA_MATRIX,
|
||||||
);
|
);
|
||||||
// super("src/test/resources/blackbox/datamatrix-1", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
|
// super("src/test/resources/blackbox/datamatrix-1", new MultiFormatReader(), BarcodeFormat.DATA_MATRIX);
|
||||||
tester.add_test(27, 28, 0.0);
|
tester.add_test(27, 27, 0.0);
|
||||||
tester.add_test(21, 26, 90.0);
|
tester.add_test(21, 25, 90.0);
|
||||||
tester.add_test(21, 26, 180.0);
|
tester.add_test(21, 25, 180.0);
|
||||||
tester.add_test(21, 26, 270.0);
|
tester.add_test(21, 25, 270.0);
|
||||||
|
|
||||||
tester.test_black_box();
|
tester.test_black_box();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user