PDF417ScanningDecoder.java (zxing-zxing-3.4.0) | : | PDF417ScanningDecoder.java (zxing-zxing-3.4.1) | ||
---|---|---|---|---|
skipping to change at line 247 | skipping to change at line 247 | |||
int[] numberOfCodewords = barcodeMatrix01.getValue(); | int[] numberOfCodewords = barcodeMatrix01.getValue(); | |||
int calculatedNumberOfCodewords = detectionResult.getBarcodeColumnCount() * | int calculatedNumberOfCodewords = detectionResult.getBarcodeColumnCount() * | |||
detectionResult.getBarcodeRowCount() - | detectionResult.getBarcodeRowCount() - | |||
getNumberOfECCodeWords(detectionResult.getBarcodeECLevel()); | getNumberOfECCodeWords(detectionResult.getBarcodeECLevel()); | |||
if (numberOfCodewords.length == 0) { | if (numberOfCodewords.length == 0) { | |||
if (calculatedNumberOfCodewords < 1 || calculatedNumberOfCodewords > PDF41 7Common.MAX_CODEWORDS_IN_BARCODE) { | if (calculatedNumberOfCodewords < 1 || calculatedNumberOfCodewords > PDF41 7Common.MAX_CODEWORDS_IN_BARCODE) { | |||
throw NotFoundException.getNotFoundInstance(); | throw NotFoundException.getNotFoundInstance(); | |||
} | } | |||
barcodeMatrix01.setValue(calculatedNumberOfCodewords); | barcodeMatrix01.setValue(calculatedNumberOfCodewords); | |||
} else if (numberOfCodewords[0] != calculatedNumberOfCodewords) { | } else if (numberOfCodewords[0] != calculatedNumberOfCodewords) { | |||
// The calculated one is more reliable as it is derived from the row indic | if (calculatedNumberOfCodewords >= 1 && calculatedNumberOfCodewords <= PDF | |||
ator columns | 417Common.MAX_CODEWORDS_IN_BARCODE) { | |||
barcodeMatrix01.setValue(calculatedNumberOfCodewords); | // The calculated one is more reliable as it is derived from the row ind | |||
icator columns | ||||
barcodeMatrix01.setValue(calculatedNumberOfCodewords); | ||||
} | ||||
} | } | |||
} | } | |||
private static DecoderResult createDecoderResult(DetectionResult detectionResu lt) throws FormatException, | private static DecoderResult createDecoderResult(DetectionResult detectionResu lt) throws FormatException, | |||
ChecksumException, NotFoundException { | ChecksumException, NotFoundException { | |||
BarcodeValue[][] barcodeMatrix = createBarcodeMatrix(detectionResult); | BarcodeValue[][] barcodeMatrix = createBarcodeMatrix(detectionResult); | |||
adjustCodewordCount(detectionResult, barcodeMatrix); | adjustCodewordCount(detectionResult, barcodeMatrix); | |||
Collection<Integer> erasures = new ArrayList<>(); | Collection<Integer> erasures = new ArrayList<>(); | |||
int[] codewords = new int[detectionResult.getBarcodeRowCount() * detectionRe sult.getBarcodeColumnCount()]; | int[] codewords = new int[detectionResult.getBarcodeRowCount() * detectionRe sult.getBarcodeColumnCount()]; | |||
List<int[]> ambiguousIndexValuesList = new ArrayList<>(); | List<int[]> ambiguousIndexValuesList = new ArrayList<>(); | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 6 lines changed or added |