-
-
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
System.Drawing.Common is deprecated on non-Windows platforms #315
Comments
Another benefit of removing this dependency would be that the library could also be used with Blazor WASM. I just tried to get a simple Wifi QR Code Generator working, but unfortunately this is not possible, since System.Drawing is not supported in Blazor WASM. |
Please don't port to If you want to stay compatible with Linux, use |
Hi Alex, I will try to port it to ImageSharp, but it may take some time. |
@codebude I just created an example for rendering QR codes in ImageSharp's examples repository, hope this will help you with the port: Note that the sample renders the code by filling pixel rows directly instead of using Drawing methods to fill rectangles. This should be more performant, and avoids taking a dependency on ImageSharp.Drawing. I recommend to wait a month or two for ImageSharp 2.0, since there will be a breaking change in the pixel processing API. In the meanwhile, the example can also help users mitigating the obsoletion of System.Drawing in their own apps, since |
It would be great to see this Library use image sharp that way all the different renderers work cross-platform. Although, You can use the |
Hi @NHodgesVFX you are right. There are a couple of renders which aren't in need of System.Drawing. PngByteQrCode is one of them. My current plans are releasing QRCode 1.4.2 with a couple of bugfixes and new features and then start working on 1.4.3 with ImageSharp. |
I've downloaded QRCoder beginning of November, threw out the Windows specific stuff and replaced System.Drawing with ImageSharp to see if it was any hassle. Fortunately it went pretty smooth, and I got pretty much everything running and tested under OSX. If you want any assistance, I could clean up that code and contribute. Cant really use what I did earlier, as I simplified it to .NET 6 only projects, and you probably don't want to loose backwards compatibility. |
Hi @st1pps , thanks for your offer. I plan to switch to ImageSharp soon, but I'm unsure if we should do it right now. In the discussion above it ws mentioned by @antonfirsov that it might be a good idea to wait for ImageSharp 2.0 because breaking changes are expected from 1.X to 2.X and thus it may make not much sense to implement against 1.X now. (Only to refactor everything again, when ImageSharp 2.0 is released.) |
@codebude sounds sensible. I'll use my fork for now and see if I can contribute later on then. Greeting from Solingen ;) |
+1 for Imagesharp implementation. |
FYI, ImageSharp 2.0.0 has just been released. |
Hello, I work on the .NET Libraries team, and I saw that this library has a lot of usage in the community and depends on System.Drawing.Common for xplat scenarios.
We just made the decision to make
System.Drawing.Common
a windows only library starting .NET6+ due to a lot of reasons after a long discussion. You can see more details here:https://github.com/dotnet/designs/blob/a15a8c7a324c482c5e38b73e46c2afe56f6bd504/accepted/2021/system-drawing-win-only/system-drawing-win-only.md
Also: dotnet/docs#25257
We wanted to reach out so that you could react to this changes when .NET 6 is released. Also if you have any questions/concerns please do let us know at https://github.com/dotnet/runtime
What is the recommended action to still support winforms/wpf scenarios for example as I see your library does?
You can mark those APIs as windows only using the
SupportedOSPlatform("windows")
annotation, and then add new APIs that use another library likeImageSharp
orSkiaSharp
.The text was updated successfully, but these errors were encountered: