codebude / QRCoder

A pure C# Open Source QR Code implementation
MIT License
4.66k stars 1.1k forks source link

Issue was in the last digit of QR Code. It was showing (. * - + and Sometimes X Y A B Z). The String is M*******7202 * is as Character. #535

Closed AshishExo closed 4 months ago

AshishExo commented 6 months ago

Type of issue

Issue was in the last digit of QR Code. It was showing (. * - + and Sometimes X Y A B Z). The String is M*****7202 * is as Character.**

How to solve this type issue??

QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(code, QRCodeGenerator.ECCLevel.Q); System.Web.UI.WebControls.Image imgBarCode = new System.Web.UI.WebControls.Image(); imgBarCode.Height = 950; imgBarCode.Width = 950; using (Bitmap bitMap = qrCode.GetGraphic(20)) { using (MemoryStream ms = new MemoryStream()) { bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Png); byte[] byteImage = ms.ToArray(); imgBarCode.ImageUrl = "data:image/png;base64," + Convert.ToBase64String(byteImage); } plBarCode.Controls.Add(imgBarCode);

    }

I am using the same code to generate the placard.

image

Using this version.

codebude commented 6 months ago

Please use the current release (1.5.1). Version 1.0 is really, really old. From where did you get it?

Besides that: can you please upload one of the broken QR code images? I like to analyze it in detail.

codebude commented 6 months ago

Tested with the current release and couldn't reproduce the error. @AshishExo please confirm, that the current release solves your problem. (You can grab the current version via Nuget: https://www.nuget.org/packages/QRCoder)

codebude commented 4 months ago

Closed issue due to lack of feedback. Feel free to re-open if the error still occurs with the latest release.