I've recently upgraded an ASP.NET MVC application from ASP.NET to ASP.NET Core.
In my controller action, I had a piece of code that relied on System.Drawing to create a profile picture
using (FileStream stream = new FileStream(HttpContext.Server.MapPath($"~/Content/UserFiles/{AuthenticatedUser.Id.ToString()}.jpg"), FileMode.OpenOrCreate))
{
Image image = Image.FromStream(model.DisplayPicture.InputStream);
image.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
}
The image data is posted to the server as a Base64 encoded image
data:image/png;base64,....
Since there's no System.Drawing
in .NET Core, are there any other libraries that can achieve this?