Android zxing NotFoundException

后端 未结 3 1406
既然无缘
既然无缘 2021-01-23 01:58

I\'m using zxing to decode QRcode images, but it always returns a NotFoundException. The online decoder at http://zxing.org/w/decode.jspx scans these images perfectly fine, so i

相关标签:
3条回答
  • 2021-01-23 02:03

    I had this problem too. And I solved it. Try add this hint to your code:

    hints.put(DecodeHintType.PURE_BARCODE, Boolean.TRUE);
    
    0 讨论(0)
  • 2021-01-23 02:22

    I solved this by: hints.put(DecodeHintType.PURE_BARCODE, Boolean.TRUE);

    0 讨论(0)
  • 2021-01-23 02:27

    According to an answer to a related question, using the TRY_HARDER decode hint might help, since it "optmizes for accuracy, not speed":

    Hashtable<DecodeHintType, Object> decodeHints = new Hashtable<DecodeHintType, Object>();
    decodeHints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
    Result result = reader.decode(bitmap, decodeHints);
    

    If the same image is being correctly interpreted in the online service but failing in your case, it's probable that they have TRY_HARDER on while you have it off.

    0 讨论(0)
提交回复
热议问题