Strangely, introducing a light blur onto the image can make it decode sometimes.
Hi,
I have a form and am putting a QR code on it for later scanning. The file is written to disk as a JPEG image with the ImageIO java class.
ImageIO.write(image, "jpg", myFile);
The encoded data is always 33 characters long. The size of the QR code is 300px.
In another process I read the images and out of 100 images around 3% cannot be read/decoded (sometimes more, sometimes less). The QR code itself seems ok. If I copy the QR code on another blank page it can be read and decoded.
Map<DecodeHintType, Object> hints = new HashMap<DecodeHintType, Object>();
hints.put(DecodeHintType.POSSIBLE_FORMATS, Arrays.asList(BarcodeFormat.QR_CODE));
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
MultiFormatReader reader = new MultiFormatReader();
reader.setHints(hints);
Result decodeResult = null;
try {
decodeResult = reader.decode(image);
}
catch(NotFoundException nfe) {
throw new ApplicationException(Type.noBarcodeFound);
}
What can I do so that all QR codes can be read? Another size? Another place on the form/page?
Attached is a part of that form.
Thanx in advance
Mihael