Mono shipped a reimplementation of the types in the System.Drawing namespace which uses GDI+ (note the +) on Windows. This reimplementation is also what CoreCompat.System.Drawing is based on. To my knowledge Mono did shim a few Windows APIs, mostly related to window messages so WndProc can be overridden in a useful manner, but not actually GDI, as far as I know.
Re:.NET Core Image Processing
by kodfodrasz on Friday January 20, 2017 @07:31AM
(#13443317)
And the implementation was buggy as hell. When I needed to resize pictures on mono + Linux I finally had to resort to manually building libgb, writing a simple wrapper for the resizing part, and use that, as back then every other alternative as either incomplete, or pain to use and/or buggy.
Note: libgd is a well designed native library with design emphasis on simple interop wrappability.
Re:.NET Core Image Processing
by jsingleton on Friday January 20, 2017 @10:05AM
(#13444283)
This makes sense as System.Drawing (aka GDI+) was mainly used for WinForms and has never been supported for web servers. I suspect Mono ported it to support their Windows Forms port.
It may just work on Windows but it won't keep working when used server-side in a web app. MS specifically recommend against using it in ASP.NET. I learned the hard way what happens if you ignore the warnings when I was supporting a site that did this.
Edit: I wrote about image optimization and resizing in chapter four of my book on ASP.NET Core - https://unop.uk/book/
Re:.NET Core Image Processing
by jamessouth on Friday January 20, 2017 @07:19PM
(#13448037)
I may have to buy that!
In practice this meant that if you were cropping an image server-side in C# code on a Linux server, a C-rewrite of a Windows UI layer would kick in and do the work for you. Amazing work from the Mono team, because it worked, but also pretty nuts.
If there's one place I remember having stuff that "just worked" on Windows and had weird subtle quirks on Mono, it's image processing (I'm talking a few years ago). So IMO it's pretty awesome that they're replacing all that legacy with a decent 100% .NET image processing library.
(Sidenote: this was also the only real problem we faced developing a C# backend with a team on Windows, Linux and OSX computers, and running it all on Mono on Docker on Linux - all well before .NET Core. Mono really is/was that good)