I receive the below error when trying to save an image which is converted from a byte array and not too sure why. Unfortunately, the error doesn't provide much detail on what the actual problem is. Error and code below
Error:
Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
and code:
byte[] imageBytes = Convert.FromBase64String(base64string);
Image image;
MemoryStream ms = new MemoryStream(imageBytes);
image = Image.FromStream(ms);
image.Save("testImage.png", System.Drawing.Imaging.ImageFormat.Png);
EDIT: this error is thrown on the image.Save line