Open romainpiel opened 5 months ago
I've tested this again by upgrading to 4.2.0 and rendering a 858 bytes string with a low error correction level results in a crash:
java.lang.IllegalArgumentException: Code length overflow (3604 > 1576)
at qrcode.raw.QRCodeProcessor.createData(QRCodeProcessor.kt:359)
at qrcode.raw.QRCodeProcessor.encode(QRCodeProcessor.kt:337)
at qrcode.raw.QRCodeProcessor.encode$default(QRCodeProcessor.kt:317)
at qrcode.QRCode.<init>(QRCode.kt:114)
at qrcode.QRCodeBuilder.build(QRCodeBuilder.kt:286)
Heya @romainpiel! I'll dig a bit around!
I've done some testing with the data you provided and indeed the ECL should not interfere with the result 🤔
Right now, I'm thinking it is related to something called TypeNumber, which is calculated from the ECL and the data type itself. I'll both fix this and perhaps expose these numbers so users can set them themselves ^^
I'll work on this issue over the weekend 😬
Thanks for bringing it in <3
Thanks a lot for your quick response @g0dkar! Did you get a chance to look into it? 🙏
Describe the bug version: 3.3.0
I'm playing with this library to render very QR codes for very long urls (900 characters) and setting the
ErrorCorrectionLevel
doesn't change anything. Digging a bit more, the error correction level is respected until 858 bytes of data, for example:Passed that threshold, setting the error correction level has no effect:
To Reproduce Steps to reproduce the behavior. For example:
render()
with a low error correction levelExpected behavior
Error correction level would be respected no matter the size of the data