Bug in Windows /.NET's System.Drawing.Save(Stream, ImageFormat). Corrupt PNG produced
问题 In some very specific situations, System.Drawing.Save(Stream, Imageformat) creates corrupt PNG images. Is there a way to avoid it, such that: I don't need to use third party libraries, and I don't need to inspect the PNG bytes to know if I need to 'repair' something? Steps to reproduce Create a System.Drawing.BitMap Add content to image such that it results in very specific PNG file size ("When does it occur") Call Save(Stream, Imageformat) -- choose PNG format What is the problem? The