Hi, I'm trying to decode this qrcode:
https://dl.dropboxusercontent.com/u/1493094/qrtest.png
directly from this file using either ZXing version 2.3.0 or 3.2.0 on Android, but I get a NotFoundException. However, if I try to scan the same qrcode using the Barcode scanner app from the phone camera, it is decoded correctly.
Even the ZXing decoding web app can't decode it:
http://zxing.org/w/decode?u=https%3A%2F%2Fdl.dropboxusercontent.com%2Fu%2F1493094%2Fqrtest.png
I also tried using TRY_HARDER but to no avail.
The qrcode has been generated by the ZXing library itself, although with the 2.3.0 version.
Here is the code I'm using:
public static String parseQrCode(Bitmap bitmap) throws Exception {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
int[] pixels = new int[width * height];
bitmap.getPixels(pixels, 0, width, 0, 0, width, height);
RGBLuminanceSource luminanceSource = new RGBLuminanceSource(width, height, pixels);
BinaryBitmap bBitmap = new BinaryBitmap(new HybridBinarizer(luminanceSource));
QRCodeReader reader = new QRCodeReader();
EnumMap<DecodeHintType, Object> hints = new EnumMap<DecodeHintType, Object>(DecodeHintType.class);
List<BarcodeFormat> decodeFormats = Arrays.asList(BarcodeFormat.QR_CODE);
hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
Result result = reader.decode(bBitmap, hints);
return result.getText();
}
The above code is correct since I'm able to decode other qrcodes, it's just this one that I can't decode.
I tried following the decoding process and it stops at com.google.zxing.qrcode.detector.Detector.computeDimension(ResultPoint, ResultPoint, ResultPoint, float), entering the "case 3" of the switch block.
Can someone help me please?
Thanks :)