[Mono-list] System.Drawing / Bitmap bug

Abe Gillespie abe.gillespie at gmail.com
Fri Jun 17 13:55:28 EDT 2005


:(  Sadly the work around does not work in my case.  I'm getting the
same results in ASP.NET with a file on disk but it's a broken image. 
The file size seems correct but it's a 0x0 pixel image.

-Abe

On 6/17/05, Abe Gillespie <abe.gillespie at gmail.com> wrote:
> Thanks for the tip, I'll give it a try.  This bug is sort of a show
> stopper for me so it's good to have a work around.
> 
> -Abe
> 
> On 6/17/05, Dilton McGowan II <diltonm at yahoo.com> wrote:
> > 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