Closed PixMod closed 3 years ago
I can reproduce in 32 string length. .Net core 3.1, QRCoder 1.3.9
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeData qrCodeData = qrGenerator.CreateQrCode("https://www.gallery.kz/p/20309pi", QRCodeGenerator.ECCLevel.Q, true, false, QRCodeGenerator.EciMode.Utf8);
QRCode qrCode = new QRCode(qrCodeData);
using (Bitmap image = qrCode.GetGraphic(pixelsPerModule, Color.Black, Color.White, true))
If you change string with the same length the qrcode will be nonrecognizable too.
Hi @morrowind ,
I could re-produce the error. It happened if someone used ECI-mode and entered a payload which maxed out a specific QR code version. Unfortunately the additional headers for ECI mode weren't taken into size calculation.
The error was fixed in: https://github.com/codebude/QRCoder/commit/012dee3edb5be2508f35ebc6a3d1d9311dc2c256 And thus will be publicly available with the next Nuget package update.
Type of issue
[ x ] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement
Expected Behavior
The QR code generated by 41 characters shall can be recognized.
Current Behavior
The QR code generated by 41 characters cannot be recognized.
Possible Solution (optional)
Steps to Reproduce (for bugs)
Note the length of "some string" should be 41, the content can be any ASCII characters, and the 4th parameter is set as
true
.Use the
code_data
to generate a bitmap.Show the bmp on screen, use other application to scan the code.
The QR code of bmp cannot be recognized.
Your Environment
Windows with .NetFramework v4.6