[Mono-list] System.Drawing / Bitmap bug

Dilton McGowan II diltonm at yahoo.com
Fri Jun 17 02:58:54 EDT 2005


I recall a problem saving to a response stream and
figured out this workaround:

bitmap.Save(memoryStream, ImageFormat.Png);
while(! memoryStream.CanWrite) {}
memoryStream.Close();


--- Abe Gillespie <abe.gillespie at gmail.com> wrote:

> I do believe I found a bug.  The following code
> works as expected in a
> normal Mono exe, but produces broken results in Mono
> ASP.NET:
> 
> using System;
> using System.IO;
> using System.Drawing;
> using System.Drawing.Imaging;
> 
> // Open an image.
> FileInfo fi = new FileInfo("existing_filename");
> Stream imgStream = fi.OpenRead();
> Bitmap img = new Bitmap(imgStream);
> 
> // Save it.
> // In a normal Mono exe this creates a valid copy of
> the original image.
> // In Mono ASP.NET this creates a new file but the
> image is broken.
> img.Save("new_filename", ImageFormat.Jpeg);
> 
> I will write a bug report if someone verifies this.
> 
> Thanks.
> -Abe
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Mono-list mailing list