I try to read QRCode stickers from scanned documents via zxing lib for java. Unfortunately the code is working, but the qrcodes coming from my Dymo Printer are not recognized at all. Here is the code I am testing the qrcodes with:
Map<DecodeHintType, Object> hintMap = new HashMap<>();
List<BarcodeFormat> possibleFormats = new ArrayList<BarcodeFormat>();
possibleFormats.add(BarcodeFormat.QR_CODE);
hintMap.put(DecodeHintType.PURE_BARCODE, Boolean.FALSE);
hintMap.put(DecodeHintType.POSSIBLE_FORMATS, possibleFormats);
hintMap.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
File f = new File("/tmp/qrcode/the-qrcode-generator.com⁄.png");
BufferedImage bi = null;
try {
bi = ImageIO.read(f);
} catch (IOException e) {
Logger.logExceptionSysOutEncapsulated(e, KickStarter.class);
}
BinaryBitmap binaryBitmap = new BinaryBitmap(
(Binarizer)new HybridBinarizer(
(LuminanceSource)new BufferedImageLuminanceSource(
bi)));
MultiFormatReader reader = new MultiFormatReader();
try {
Result resulta = reader.decode(binaryBitmap, hintMap);
Logger.logInfoSysOutEncapsulated(resulta.getText(), KickStarter.class);
} catch (NotFoundException e) {
Logger.logExceptionSysOutEncapsulated(e, KickStarter.class);
}
I know the Code is working, because if I try with a generated qrCode image from https://www.the-qrcode-generator.com/ it works just fine. But the generated Codes from the Dymo Connect Software are not recognized whatsoever. So this works:
whereas this one is not working:
Can anyone familiar with the QRCode Standards see the problem here?