-
Notifications
You must be signed in to change notification settings - Fork 237
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
Charge target to netstandard2.0 and remove dependency to ImageSharp #32
Conversation
As far as I know, your change appears to go against the purpose of this fork. (But I can't speak for @ststeiger so I don't know what he intended) There is already another .NET Standard fork of PdfSharp that uses System.Drawing. System.Drawing requires additional libraries to be installed to use outside of Windows, (libgdiplus on Linux for example) and is not officially supported in headless (services, web apps) environments despite the fact that most people used it that way on Windows. It is also not thread safe. ImageSharp was designed to solve these problems - It's multi-platform .NET managed code with no native dependencies, works headless, and is thread safe. By getting rid of ImageSharp in your PR you re-introduce those limitations. I started using ImageSharp and this fork a few weeks ago and found that it (ImageSharp) supported all of the drawing features we needed despite being slightly slower to draw than GDI+. Given that my team was incorrectly using System.Drawing in a server environment for years when we should not have been, we agreed that switching to ImageSharp was a good idea. I would recommend keeping ImageSharp unless Microsoft intends to make System.Drawing officially supported in headless environments. Thoughts? |
@Sappharad: Yea, not entirely. |
@Sappharad @ststeiger As far as I understand,
However, while I agree about the backwards compatibility break, I recommend using official packages provided by Microsoft. The ImageSource implementation should be retrieved via dependeny injection, in my opinion, if you want to keep it customizable. |
@PhenX The same article you linked does mention the native dependencies that must be installed on the server to use it on Linux
The article you linked also mentions that you should not be using System.Drawing for new code.
Scott's first recommendation is ImageSharp, which is exactly what you removed in this PR. |
@PhenX: Be careful about everything you read on hanselman's blog. So for one, you need superuser-rights to install libgdiplus. Besides, I ported the full PdfSharp 1.5 to NetStandard, here. Also, in some settings on Azure, you can't use GDI+. |
haha, I had to chuckle at this...
Which of your ports would you recomment to use on Linux then? Core or NetStandard? |
|
No description provided.