Open juztin opened 4 years ago
I can't reproduce this:
[tfh@localhost ~]$ go/bin/qrcode "88c77c18" > 88c77c18.png
[tfh@localhost ~]$ zbarimg 88c77c18.png
QR-Code:88c77c18
scanned 1 barcode symbols from 1 images in 0.02 seconds
[tfh@localhost ~]$
Here is the image: https://skip.org/drop/88c77c18.png https://zxing.org/w/decode?u=https%3A%2F%2Fskip.org%2Fdrop%2F88c77c18.png
Can you link to the image you generated? Which software did you use to decode it?
I did notice that I was behind on commits (was on dc11ecd
)
Just to make sure I was running against the binary built from this project, from current `master:
git pull
rm $GOPATH/bin/qrcode
go install ./...
$GOPATH/bin/qrcode "88c77c18" > 88c77c18.png
The resulting QR-Code decodes to c77c18
If I replace the first the 88
prefix: asdfasdfasdfc77c18
, it works
If I prefix it, again, with the eights: 88asdfasdfasdfc77c18
, it decodes to: asdfasdfasdfc77c18
If I run directly from the repo: go run qrcode/main.go "88c77c18" > 888c77c18.png
it decodes to c77c18
I've tried running in both zsh
and bash
(just to trying to rule everything out), as well as copying your command above (just replacing the first part with go run qrcode/main.go
in the repo directory)
Here's a few other scenarios I've run _(all using go run qrcode/main.go ...
:
8888888888
== ""88888888885555
== ""8888888888aaaa
== "aaaa"8888888888aaaa8888
== "aaaa"8888888888aaaa8888a8a8a8a
== "aaa"8888888888aaaa8888a8a8a8o
== results in an invalid QR-Code8aaaa8o
== "aaaa8o"8aaaa8oooooo8o8o8o8o
== "aaaa8oooooo8o8o8o8o"16aaaa
== "aaaa"2aaaa
== "aaaa"3aaaa
== "aaaa"
a3aaaa
== "a3aaaa"##3aaaa
== "##3aaaa"Just to rule out my machine, I also did the following (same results):
docker run -it --rm --volume "$(pwd)":/output golang
go get -u github.com/skip2/go-qrcode/...
qrcode "3aaaa" > /output/3aaaa.png
Can your decoder software read "88c77c18" from https://skip.org/drop/88c77c18.png ? Which decoder software are you using? Can you attach your 3aaaa.png?
QR Codes can contain multiple data types, namely: numeric, alphanumeric, and byte. This minimises the size of each QR code, e.g. as numeric data can be encoded more efficiently than byte data.
If you are having problems decoding numbers, it's possible your decoder software can't decode numeric encoded data correctly.
I have encoded "8888888888aaaa8888" two different ways below. If you can only decode the first type correctly, then your decoder software is broken.
Data segment #0: data type byte: '8888888888aaaa8888'
Data segment #0: data type numeric: '8888888888' Data segment #1: data type byte: 'aaaa' Data segment #2: data type numeric: '8888'
If neither decodes correctly, then you are probably parsing the output of your decoder incorrectly.
Is this still an issue?
When running:
The generated code seems to only decode to: