MultiFormatReader.java (zxing-zxing-3.4.1) | : | MultiFormatReader.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 132 | skipping to change at line 132 | |||
if (formats.contains(BarcodeFormat.QR_CODE)) { | if (formats.contains(BarcodeFormat.QR_CODE)) { | |||
readers.add(new QRCodeReader()); | readers.add(new QRCodeReader()); | |||
} | } | |||
if (formats.contains(BarcodeFormat.DATA_MATRIX)) { | if (formats.contains(BarcodeFormat.DATA_MATRIX)) { | |||
readers.add(new DataMatrixReader()); | readers.add(new DataMatrixReader()); | |||
} | } | |||
if (formats.contains(BarcodeFormat.AZTEC)) { | if (formats.contains(BarcodeFormat.AZTEC)) { | |||
readers.add(new AztecReader()); | readers.add(new AztecReader()); | |||
} | } | |||
if (formats.contains(BarcodeFormat.PDF_417)) { | if (formats.contains(BarcodeFormat.PDF_417)) { | |||
readers.add(new PDF417Reader()); | readers.add(new PDF417Reader()); | |||
} | } | |||
if (formats.contains(BarcodeFormat.MAXICODE)) { | if (formats.contains(BarcodeFormat.MAXICODE)) { | |||
readers.add(new MaxiCodeReader()); | readers.add(new MaxiCodeReader()); | |||
} | } | |||
// At end in "try harder" mode | // At end in "try harder" mode | |||
if (addOneDReader && tryHarder) { | if (addOneDReader && tryHarder) { | |||
readers.add(new MultiFormatOneDReader(hints)); | readers.add(new MultiFormatOneDReader(hints)); | |||
} | } | |||
} | } | |||
if (readers.isEmpty()) { | if (readers.isEmpty()) { | |||
if (!tryHarder) { | if (!tryHarder) { | |||
readers.add(new MultiFormatOneDReader(hints)); | readers.add(new MultiFormatOneDReader(hints)); | |||
} | } | |||
skipping to change at line 178 | skipping to change at line 178 | |||
private Result decodeInternal(BinaryBitmap image) throws NotFoundException { | private Result decodeInternal(BinaryBitmap image) throws NotFoundException { | |||
if (readers != null) { | if (readers != null) { | |||
for (Reader reader : readers) { | for (Reader reader : readers) { | |||
try { | try { | |||
return reader.decode(image, hints); | return reader.decode(image, hints); | |||
} catch (ReaderException re) { | } catch (ReaderException re) { | |||
// continue | // continue | |||
} | } | |||
} | } | |||
if (hints != null && hints.containsKey(DecodeHintType.ALSO_INVERTED)) { | ||||
// Calling all readers again with inverted image | ||||
image.getBlackMatrix().flip(); | ||||
for (Reader reader : readers) { | ||||
try { | ||||
return reader.decode(image, hints); | ||||
} catch (ReaderException re) { | ||||
// continue | ||||
} | ||||
} | ||||
} | ||||
} | } | |||
throw NotFoundException.getNotFoundInstance(); | throw NotFoundException.getNotFoundInstance(); | |||
} | } | |||
} | } | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 13 lines changed or added |