I have a WebAPI endpoint (hosted in IIS) that reads images from a database (byte array) and returns them in the PNG format. This code is simple: Image img = ImageHelper.ReadFromDatabase(…); using (MemoryStream ms = new MemoryStream()) { img.Save(ms, System.Drawing.Imaging.ImageFormat.Png); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new ByteArrayContent(ms.ToArray()); response.Content.Headers.ContentType = [...] read more
I have an ASP.NET-MVC project where I need to dynamically generate some png images. That's easy. I just create ActionResult that returns FileSreamResult object. To generate images I used classes from System.Drawing such as Bitmap and Image. Everything works fine on local machine and on production server. But when IIS [...] read more
We have started facing an issue in the past months where the method System.Drawing.Bitmap.Save(string filename) stops working after the server has been running for several hours. The hours after which it starts failing are proportional to the server load. This code involved with that call has been working perfectly well [...] read more