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

Circle QR code not recognized #130

Open
Arclud opened this issue Apr 7, 2024 · 4 comments
Open

Circle QR code not recognized #130

Arclud opened this issue Apr 7, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Arclud
Copy link

Arclud commented Apr 7, 2024

Describe the bug
I created a QR code with the following code
val circleQRCode = QRCode.ofCircles().build("https://sample/alphaskfhdbfebwhnewnew/sdjnbchbwdhvbewhbvhuew") val circlePngData = circleQRCode.render()

To save image on .png format I use the following code (it will be works for android 13 and newest version)
internal class SavePhotoTask(private val context: Context) : AsyncTask<ByteArray?, String?, String?>() { protected override fun doInBackground(vararg jpeg: ByteArray?): String? { val photo = File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS).toString(), "photo.png") if (photo.exists()) { photo.delete() } try { val fos = FileOutputStream(photo.path) fos.write(jpeg[0]) fos.close() } catch (e: IOException) { Log.e("PictureDemo", "Exception in photoCallback", e) } return null } }

Note: No problem with scanning if I generate rectangle QR instead of circle , also your QR with name example01-circles.png was scanned perfectly but I do not now why since i used same code

Generated following QR
photo

Additional context

Finally, I accept that the generated image is not detected fast, for example, I use Google Scanner, the default application scanner but there are not working perfectly, freeze

I use for testing following devices:
Google pixel 7 (android 14)
Redmi not 9s (android 12)

@Arclud Arclud added the bug Something isn't working label Apr 7, 2024
@g0dkar
Copy link
Owner

g0dkar commented Apr 7, 2024

Heya! Thanks for bringing this up!

I think I know what the issue is: those outer squares should have a larger center one. And they should be slightly smaller. I'll tune it out and let you know when the new version is out =D

@g0dkar
Copy link
Owner

g0dkar commented Apr 7, 2024

Hello again ^^

I've adjusted the Android rendering and got this QRCode here:

image

It should decode to example - Google's ZXing Online Decoder seems able to process it:

image

Let me know if this QRCode is working with your device. If it is NOT readable, I'll try tune it a bit more ❤️

@Arclud
Copy link
Author

Arclud commented Apr 8, 2024

@g0dkar
Thank you for your hard work , I really appreciate 🙇
I confirm your QR code scanned very well (tested on Google Pixel , Redmi note 9s)
I guess we can close this issue ❤️

@g0dkar
Copy link
Owner

g0dkar commented Apr 8, 2024

Glad to know its working =D

I'll leave it open for now so it can be closed when #131 is merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants