g0dkar / qrcode-kotlin

QRCode Generator implemented in pure Kotlin
https://qrcodekotlin.com/
MIT License
172 stars 16 forks source link

Library broken #7

Closed kalinjul closed 2 years ago

kalinjul commented 2 years ago

This library randomly produces invalid QR-Codes that can't be scanned.

g0dkar commented 2 years ago

Heya! Can you share some examples so I can try them out?

I couldn't reproduce this behavior, so maybe it is related to what you were trying to create QR-Codes to.

Thanks!

kalinjul commented 2 years ago

I'm sorry for leaving this comment yesterday, i was so annoyed about this yesterday... out of 20 generated QR-Codes, almost none worked. Here's an example using v2.0.0 of your library: QRCode("mOeL5ImYCfSVmZcWSG9k54zm7XHEm32yN3U71KdBP7XEvEAbV1acKlzdOfc7R1mOeL5ImYCfSVmZcWSG9k54zm7XHEm32yN3U71KdBP7XEvEAbV1acKlzdOfc7R1").render().writeImage(File("testqrcode.png").outputStream())

testqrcode

This string is (a part of) base64 encoded encrypted data. I chose a part of my real data that does not contain special characters and still fails to decode (also, the example string repeats itself).

Cannot be scanned by iOS Camera, also tried webqr.com.

g0dkar commented 2 years ago

Thanks for sharing! Don't worry about the initial comment, we all get frustrated ^^

I had to take a break to focus on some personal stuff, I'll check this out now!

Sorry for the delay!

I'll let you know when I get something :D

g0dkar commented 2 years ago

@kalinjul I found the issue! I'm uploading a new version with the fixes soon! Thanks for the bug report! ❤️

It was a mistake I made on a small calculation on setting up a type pattern IF the data was over a certain size 😅

I'll add a test for this case in a future version :)

kalinjul commented 2 years ago

Hey, thanks for fixing this!