DEBUG and RELEASE modeDownloading certain png as a byte array or a stream results in errors. Either "stream is invalid" or "png contains no data chunk" etc.
var client = _httpClientFactory.CreateClient();
var bytes = await client.GetStreamAsync(p.ImageUrl);
var image = SixLabors.ImageSharp.Image.Load(bytes, new PngDecoder());
Here are the images:


Try the following:
c#
var client = _httpClientFactory.CreateClient();
using(var bytes = await client.GetStreamAsync(p.ImageUrl)) {
// Remember to dispose of this image once you are finished.
var image = SixLabors.ImageSharp.Image.Load(bytes, new PngDecoder());
}
It looks to me like you're having the same issue as https://github.com/SixLabors/ImageSharp/issues/1029#issuecomment-544061230
Switched to the suggested code, same issue. ImageFormatException: Image stream is not valid.
Edit: I did see similar issues, but I thought there might be something distinctly wrong with the png files in question. Maybe the metadata is off somehow, or something nonstandard is going on.
Edit#2: I ran both files through pngcheck, and it reports "EOF while reading CRC value."
What happens when you copy your input stream to a MemoryStream and load via that? Something is causing your stream not to flush.
I'm assuming of course, that the requests are successful.
Same thing happens.
Thanks for the extra info, I appreciate it.
I ran both files through pngcheck, and it reports "EOF while reading CRC value.
I have done some investigation and confirmed your findings. However we are attempting to read the crc data from those images and throwing an error whether they are critical or not. I will work on a fix asap.