mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Merge pull request #453 from graug/dev
Ignore additional PDF417 barcode rows, https://github.com/zxing/zxing/issues/449
This commit is contained in:
commit
c44ee5e587
|
@ -122,7 +122,8 @@ final class DetectionResultRowIndicatorColumn extends DetectionResultColumn {
|
|||
if (codeword != null) {
|
||||
int rowNumber = codeword.getRowNumber();
|
||||
if (rowNumber >= result.length) {
|
||||
throw FormatException.getFormatInstance();
|
||||
// We have more rows than the barcode metadata allows for, ignore them.
|
||||
continue;
|
||||
}
|
||||
result[rowNumber]++;
|
||||
} // else throw exception?
|
||||
|
|
|
@ -343,7 +343,8 @@ public final class PDF417ScanningDecoder {
|
|||
int rowNumber = codeword.getRowNumber();
|
||||
if (rowNumber >= 0) {
|
||||
if (rowNumber >= barcodeMatrix.length) {
|
||||
throw FormatException.getFormatInstance();
|
||||
// We have more rows than the barcode metadata allows for, ignore them.
|
||||
continue;
|
||||
}
|
||||
barcodeMatrix[rowNumber][column].setValue(codeword.getValue());
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ public final class PDF417BlackBox1TestCase extends AbstractBlackBoxTestCase {
|
|||
|
||||
public PDF417BlackBox1TestCase() {
|
||||
super("src/test/resources/blackbox/pdf417-1", new MultiFormatReader(), BarcodeFormat.PDF_417);
|
||||
addTest(9, 9, 0.0f);
|
||||
addTest(9, 9, 180.0f);
|
||||
addTest(10, 10, 0.0f);
|
||||
addTest(10, 10, 180.0f);
|
||||
}
|
||||
|
||||
}
|
BIN
core/src/test/resources/blackbox/pdf417-1/11.png
Normal file
BIN
core/src/test/resources/blackbox/pdf417-1/11.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
1
core/src/test/resources/blackbox/pdf417-1/11.txt
Normal file
1
core/src/test/resources/blackbox/pdf417-1/11.txt
Normal file
|
@ -0,0 +1 @@
|
|||
This is just a test.
|
Loading…
Reference in a new issue