Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulty finding library dependencies #450

Closed
stictt opened this issue Apr 10, 2023 · 4 comments
Closed

Difficulty finding library dependencies #450

stictt opened this issue Apr 10, 2023 · 4 comments

Comments

@stictt
Copy link

stictt commented Apr 10, 2023

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.

@benchd
Copy link

benchd commented Apr 13, 2023

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.

@lqlam
Copy link

lqlam commented Apr 24, 2023

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 "";
}

@pishangujeniya
Copy link

Thanks @lqlam , Even I found little fishy, when I saw the lines

#if NET6_0_WINDOWS

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

@codebude
Copy link
Owner

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 codebude reopened this May 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants