Docker Desktop CE (latest stable version: 2.1.0.4)
Visual Studio 2019 preview (but the same thing happens also with VS2017)
For the details of the execution, please see the Dockerfile on the project; as summary, i can say that it is a Linux Alpine (latest official microsoft/dotnet2.2-aspnetcore-runtime from dockerhub) plus the latest available version of libgdiplus.
The problem arise when we try to open a particular image with System.Drawing.Image.FromStream: if the image is nearly empty (see the example posted) a native exception is executed and the program end abruptly, without even giving the chance to manage the error. The same image opened with System.Drawing.Image.FromFile works fine (except that it is locked by the GDI+ engine).
Copied over from: https://github.com/dotnet/runtime/issues/31276
.Net Core version affected: 2.2
I can reproduce the problem in my development environment; please see the following repository to have a working example:
https://github.com/LeonSebastianCoimbra/ImageFromStreamError
The tools used are:
For the details of the execution, please see the Dockerfile on the project; as summary, i can say that it is a Linux Alpine (latest official microsoft/dotnet2.2-aspnetcore-runtime from dockerhub) plus the latest available version of libgdiplus.
The problem arise when we try to open a particular image with System.Drawing.Image.FromStream: if the image is nearly empty (see the example posted) a native exception is executed and the program end abruptly, without even giving the chance to manage the error. The same image opened with System.Drawing.Image.FromFile works fine (except that it is locked by the GDI+ engine).
To reproduce the problem:
You'll see that the fist two attempts to open the file with "FromFile" will work, while the last one will fails.
cc: @akoeplinger @LeonSebastianCoimbra