ITFReader.java (zxing-zxing-3.4.0) | : | ITFReader.java (zxing-zxing-3.4.1) | ||
---|---|---|---|---|
skipping to change at line 233 | skipping to change at line 233 | |||
* | * | |||
* @param row bit array representing the scanned barcode. | * @param row bit array representing the scanned barcode. | |||
* @param startPattern index into row of the start or end pattern. | * @param startPattern index into row of the start or end pattern. | |||
* @throws NotFoundException if the quiet zone cannot be found | * @throws NotFoundException if the quiet zone cannot be found | |||
*/ | */ | |||
private void validateQuietZone(BitArray row, int startPattern) throws NotFound Exception { | private void validateQuietZone(BitArray row, int startPattern) throws NotFound Exception { | |||
int quietCount = this.narrowLineWidth * 10; // expect to find this many pix els of quiet zone | int quietCount = this.narrowLineWidth * 10; // expect to find this many pix els of quiet zone | |||
// if there are not so many pixel at all let's try as many as possible | // if there are not so many pixel at all let's try as many as possible | |||
quietCount = quietCount < startPattern ? quietCount : startPattern; | quietCount = Math.min(quietCount, startPattern); | |||
for (int i = startPattern - 1; quietCount > 0 && i >= 0; i--) { | for (int i = startPattern - 1; quietCount > 0 && i >= 0; i--) { | |||
if (row.get(i)) { | if (row.get(i)) { | |||
break; | break; | |||
} | } | |||
quietCount--; | quietCount--; | |||
} | } | |||
if (quietCount != 0) { | if (quietCount != 0) { | |||
// Unable to find the necessary number of quiet zone pixels. | // Unable to find the necessary number of quiet zone pixels. | |||
throw NotFoundException.getNotFoundInstance(); | throw NotFoundException.getNotFoundInstance(); | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |