$ uname -a
Linux koda 3.13.0-24-lowlatency #47-Ubuntu SMP PREEMPT Fri May 2 23:59:20 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
$ zbarimg --version
0.10
I created a 2d barcode out of binary data (part of the QR Code standard):
$ dd if=/dev/urandom bs=1 count=1024 > rand-1k
$ cat rand-1k | qrencode -l M -8 -o rand-1k.png
When I try to decode it with zbarimg:
$ zbarimg --verbose=32 --raw rand-1k.png
_zbar_process_image: processing: Y800(30303859) 387x387 @0x7f048c064010
_zbar_qr_decode: 349x357 finders, 16 centers:
_zbar_process_image: QR-Code: ãèT (4 pts) (q=1) (new)
ãèT
scanned 1 barcode symbols from 1 images in 0.07 seconds
dump_stats: symbol sets allocated = 1
dump_stats: scanner syms in use = 0 recycled = 0
dump_stats: image syms in use = 0 recycled = 0
dump_stats: symbols allocated = 1
dump_stats: recycled[0] = 0
dump_stats: recycled[1] = 0
dump_stats: recycled[2] = 0
dump_stats: recycled[3] = 0
dump_stats: recycled[4] = 0
_zbar_qr_destroy: max finder lines = 511x511
bill@kona:~/tmp/code$
Ideally there would be a way to send the resulting raw bytes either to stdout or to a filename.
Hi,
Binary data is working with mercurial head fine for years now. It doesn't work in the source tarball though.
It was output on stdout in your example: "ãèT" is the binary data from the barcode. You can redirect this to a file the same way you redirected the output of dd, with the '>' operator.
Unfortunately zbar assumes you want the data in UTF-8, so to recover the original bytes exactly you can use iconv:
zbarimg --raw rand-1k.png | iconv -f UTF-8 -o ISO-8859-1 > outputfile
zbar adds a single character (the linebreak) to every barcode decoded.