-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use SkiaSharp to support SvgQRCode in .NET6 #462
base: master
Are you sure you want to change the base?
Conversation
QRCoder/QRCoder.csproj
Outdated
<PackageReference Include="SkiaSharp"> | ||
<Version>2.88.3</Version> | ||
</PackageReference> | ||
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.1" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImageSharp 3.0.1 has a conditionally commercial license, can this be a problem?
https://github.com/SixLabors/ImageSharp/blob/v3.0.1/LICENSE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting question, I am not an expert about this but below is my thought
For my understanding, QRCoder is a open source package under MIT license, which is able to apply apache license.
For developer using QRCoder, ImageSharp is serve as Transitive Package so it may also apply apache license.
Works in Source or Object form are licensed to You under the Apache License, Version 2.0 if.
- You are consuming the Work in for use in software licensed under an Open Source or Source Available license.
- You are consuming the Work as a Transitive Package Dependency.
- You are consuming the Work as a Direct Package Dependency in the capacity of a For-profit company/individual with
less than 1M USD annual gross revenue.
- You are consuming the Work as a Direct Package Dependency in the capacity of a Non-profit organization
or Registered Charity.
For all other scenarios, Works in Source or Object form are licensed to You under the Six Labors Commercial License
which may be purchased by visiting https://sixlabors.com/pricing/.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guy in medium says that if the dependency depends on something with the license that isn't compliant it is a reason to worry https://medium.com/@vovabilonenko/licenses-of-npm-dependencies-bacaa00c8c65. So, the commercial project won't be able to safely use QRCoder with this dependency. Probably it will be good to move the potentially dangerous dependency to the separate package. Or to downgrade image sharp to 2.*, because it is under apache 2.0. Probably it is something that maintainers will decide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might be a concern, I just committed another one that remove ImageSharp and use SkiaSharp only.
I wouldn't endorse adding a third party (non-MS) dependency to the base QRCoder NuGet package. I would rather see something like PR #407 where there are separate packages depending on the needs of the user. |
Summary
Created a new class SvgQRCode_NET6 to support SvgQRCode is .NET6 including non-Windows platform like Linux.
This PR fixes/implements the following bugs/features:
What existing problem does the pull request solve?**
Since NET6, System.Drawing is no longer support unless it is running in Windows, to make it work in other OS like Linux, this pull request introduce SkiaSharp to replace System.Drawing in .NET6. The new class SvgQRCode_NET6 is basically the same as SvgQRCode in .NET5 or before but skipping System.Drawing
Test plan
Closing issues
Fixes #