makiuchi-d / gozxing

Port of ZXing (https://github.com/zxing/zxing) core to pure Go.
Other
565 stars 65 forks source link

error while parsing qr code image #36

Closed joicemjoseph closed 3 years ago

joicemjoseph commented 4 years ago

I am getting error while trying to parse qr code png image.

"NotFoundException: (w, h) = (492, 492), (x, y) = (63, -7)" is the error message I am getting.

I am sorry, I cant attach the sample QR code with you.

code

f, _ = ioutils.ReadFile(filepath)
require.NoError(t, err)
img, _, err := image.Decode(f)
require.NoError(t, err)

bmp, err := gozxing.NewBinaryBitmapFromImage(img)
require.NoError(t, err)
// decode image
qrReader := qrcode.NewQRCodeReader()
result, err := qrReader.Decode(bmp, nil)
require.NoError(t, err) // Error is thrown here.
makiuchi-d commented 4 years ago

y=-7 seems to be an invalid value, but I'm not sure without the sample QR code.

joicemjoseph commented 4 years ago

but the qr code is valid. I tried with another library and it worked.

makiuchi-d commented 4 years ago

I mean, show me that qr code.