Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notFoundException on a valid QR images #70

Open
LindyLo opened this issue Aug 31, 2024 · 1 comment
Open

notFoundException on a valid QR images #70

LindyLo opened this issue Aug 31, 2024 · 1 comment

Comments

@LindyLo
Copy link

LindyLo commented Aug 31, 2024

Hello

I have a "collection" of QR images that cause following errors when I try to decode them :

%!w(gozxing.notFoundException={{NotFoundException {{NotFoundException {{NotFoundException: (w, h) = (512, 512), (x, y) = (536, -26) {[4376226640 4376226469 4376225072]}}} {[4376225217 4376225381 4376305616]}}} {[4376304089 4376304265 4376302624]}}})panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104d974e0]

The code I'm using to try and decode :

		img, err := png.Decode(file)
		if err != nil {
			fmt.Printf("Error decoding PNG image: %v\n", err)
			break
		}

		bmp, err := gozxing.NewBinaryBitmapFromImage(img)
		if err != nil {
			fmt.Printf("%w", err)
		}

		qrReader := gozxingQR.NewQRCodeReader()
		r, err := qrReader.Decode(bmp, nil)
		if err != nil {
			fmt.Printf("%w", err)
		}

I'm including 3, but I can provide more if needed.

bc1qw4yf73y40mql98up986at64qmkxy6rfqqnh0wn

KwZP8JWwNCMk8hBwCNMggTsTqonPfSTYQtcrvXyoYQnVgwtLX72M

KxzYQuYqTzmAbgxQaJFNMxeruwqE1Es7bwNEXrE7twsSKwLbjRFs

@makiuchi-d
Copy link
Owner

Try with DecodeHintType_PURE_BARCODE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants