Why the dimension is 17

51 views
Skip to first unread message

hao wang

unread,
Mar 25, 2015, 9:14:12 PM3/25/15
to zx...@googlegroups.com
I want decode the QrCode Image with zxing, below is my code:

public class Test {
public static void main(String[] args) {
String path = "E:\\study\\QRCode\\someimages\\qq.png";
try {
Map<DecodeHintType, Object> tmpHintsMap = new EnumMap<DecodeHintType, Object>(
DecodeHintType.class);
tmpHintsMap.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
BinaryBitmap binaryBitmap = new BinaryBitmap(new HybridBinarizer(
new BufferedImageLuminanceSource(
ImageIO.read(new FileInputStream(path)))));
Result qrCodeResult = new MultiFormatReader().decode(binaryBitmap,
tmpHintsMap);

System.out.println(qrCodeResult.getText());
} catch (Exception e) {
e.printStackTrace();
}
}

}
My QrCode image is qq_qrcode_image.png, get it from attachment file. I got it from website: http://www.qrstuff.com/,see the attachment file generate_qrcodeimage.png.

I can’t decode this image successfully with my code, but this can be decoded successfully with other qrcode tool.
I follow the debug stack, find the real reason is the dimension be computed is 17.I this case, the Qr version will be zero. The exception “com.google.zxing.NotFoundException” will be thrown. see the attachment file the_debug_stacktrace.png.
I don’t why, could you give me some advice?

Thanks in advanced!
Tom


generate_qrcodeimage.png
the_debug_stacktrace.png
qq_qrcode_image.png

Lachezar Dobrev

unread,
Mar 26, 2015, 11:29:05 AM3/26/15
to hao wang, zxing
This decodes with my Android Phone.
This also decodes with the Java SE client using the --pure_barcode parameter.
This also decodes with the Java SE client with 90° rotation.

It might be hitting some corner case.
> --
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to zxing+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages