use of com.google.zxing.multi.qrcode.QRCodeMultiReader in project collect by opendatakit.
the class QRCodeUtils method decodeFromBitmap.
public static String decodeFromBitmap(Bitmap bitmap) throws DataFormatException, IOException, FormatException, ChecksumException, NotFoundException {
Map<DecodeHintType, Object> tmpHintsMap = new EnumMap<>(DecodeHintType.class);
tmpHintsMap.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
tmpHintsMap.put(DecodeHintType.POSSIBLE_FORMATS, BarcodeFormat.QR_CODE);
tmpHintsMap.put(DecodeHintType.PURE_BARCODE, Boolean.FALSE);
Reader reader = new QRCodeMultiReader();
Result result = reader.decode(getBinaryBitmap(bitmap), tmpHintsMap);
return CompressionUtils.decompress(result.getText());
}
Aggregations