QRCoder icon indicating copy to clipboard operation
QRCoder copied to clipboard

Difficulty finding library dependencies

Open stictt opened this issue 2 years ago • 4 comments

Hello, I noticed one problem. The library does not indicate any limitations or requirements. You can understand this only if you open the code like here. image I suggest that you add platform and limit information to the ReadMe file.

stictt avatar Apr 10 '23 03:04 stictt

I ran into the same issue. I am using the current net 7.0 and just tried to use and am getting a missing QRCode. It looks like I can't use this.

benchd avatar Apr 13 '23 10:04 benchd

You should use forked project from https://github.com/JPlenert/QRCoder-ImageSharp with net7 support. It use ImageSharp by SixLabors.

Here is my sample code:

@using QRCoder @using SixLabors @using SixLabors.ImageSharp.Formats

private string GenerateQRCode(string inputText) { if (!string.IsNullOrEmpty(inputText)) { using (MemoryStream memoryStream = new MemoryStream()) { QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(inputText, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); using (Image qrCodeImage = qrCode.GetGraphic(20)) { qrCodeImage.SaveAsPng(memoryStream); return "data:image/png;base64," + Convert.ToBase64String(memoryStream.ToArray()); } } } return ""; }

lqlam avatar Apr 24 '23 09:04 lqlam

Thanks @lqlam , Even I found little fishy, when I saw the lines https://github.com/codebude/QRCoder/blob/cecf2066d3f3a74b142aaa7c8d9f744c4673118c/QRCoder/QRCode.cs#L9

It saved me a lot of time. I started using the library suggested by you - https://www.nuget.org/packages/QRCoder-ImageSharp

pishangujeniya avatar May 28 '23 16:05 pishangujeniya

Hi @pishangujeniya , hi @lqlam ,

Sorry to hear that you struggled with the library. I tried to document this in the wiki. Check the compatibility matrix over here: https://github.com/codebude/QRCoder/wiki/Advanced-usage---QR-Code-renderers#2-overview-of-the-different-renderers Seems like this wasn't clear enough.

I'm also unhappy with the situation and how imports are solved. The thing is: I started QRCoder in 2013 as a fresher. Back then full, classic .NET Framework was state of the art and System.Drawing was available everywhere. So I built QRCoder upon it. Then over the years I tried to add support for more and more .NET variants/versions which lead to the mess (incl. compiler flags) that you pointed out.

Unfortunately I'm constantly in lack of time and in addition are a bit overwhelmed. I would love to give QRCoder the update it deserves, but fear to break it when cutting off loose ends (like older .NET support).

It's some kind of dilemma. Maybe I can find 1-3 person to build up a team to develop QRCoder 2.0. (Yes, I got some cool PRs from single persons, but I haven't merged them, because I feared possible side effects. If we could work/decide as team, I would feel way more confident in updating the sources.)

codebude avatar May 28 '23 18:05 codebude