qrcode-kotlin icon indicating copy to clipboard operation
qrcode-kotlin copied to clipboard

Circle QR code not recognized

Open Arclud opened this issue 1 year ago • 4 comments
trafficstars

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 avatar Apr 07 '24 08:04 Arclud

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 avatar Apr 07 '24 14:04 g0dkar

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 ❤️

g0dkar avatar Apr 07 '24 19:04 g0dkar

@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 ❤️

Arclud avatar Apr 08 '24 02:04 Arclud

Glad to know its working =D

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

g0dkar avatar Apr 08 '24 03:04 g0dkar