[Mono-list] GDI+ and Mono 2.0.1

Sebastien Pouliot sebastien.pouliot at gmail.com
Fri Feb 13 14:14:30 EST 2009


On Fri, 2009-02-13 at 20:13 +0100, Bálint Kardos wrote:
> Hi Sebastien,
> 
> 
> I've installed a clear Ubuntu 8.04 version and have Mono 1.9 running.
> Finally, it is partly working for now.
> 
> 
> The main error was with the incomplete GDI packages on the old Fedora
> I was using, as I thought so before.

Great! I'm glad you could sort it out.

> Now the program is writing text to the PNG canvas, BUT with a default
> font, not with the custom one I've choosed.
> 
> 
> I think now it qualifies for a Bugzilla bugreport :)

Yes, that should be easy to duplicate.

Thanks
Sebastien

> 
> Thanks again,
> 
> 
> b.
> 
> 
> 
> 
> 
> üdvözlettel
> with regards
> 
> Kardos Bálint
> _______________________________________
> http://skaelede.hu 10 (0xA) év a magyar weben
> 
> 
> On Wed, Feb 4, 2009 at 20:02, Sebastien Pouliot
> <sebastien.pouliot at gmail.com> wrote:
>         On Wed, 2009-02-04 at 19:27 +0100, Bálint Kardos wrote:
>         > Hi Sebastien,
>         >
>         >
>         > thanks for your reply!
>         > I only want to deploy it on the Linux server, so I'm working
>         on this
>         > part first.
>         >
>         >
>         > I found the solution, it had no rights to write to a given
>         folder.
>         
>         
>         Yep, a bit lame but this is how GDI+/SD reports such
>         permission issues.
>         
>         >  It now executes, but the output file is just 192 bytes
>         long, and only
>         > has the header of the PNG stream.
>         
>         
>         My previous suggestion still applies. Once you have a small
>         EXE it will
>         be much easier to debug (and/or trace) to see what's going on.
>         
>         > The whole process is the following:
>         >
>         >
>         > 1)  open a 24bit PNG file
>         > 2)  add the text
>         > 3)  save the file to a given directory
>         > 4)  send it to the out stream
>         >
>         >
>         > Image.FromFile would throw an exception if it would not find
>         the
>         > original file,
>         > the TextWriter would throw an exception if it would not find
>         the font,
>         
>         
>         TextWriter / font ? not likely ;-)
>         
>         > so I can't find any reason why it's not working.
>         
>         
>         Try to remove step 2 (adding the text) and see if a copy of
>         the original
>         file is saved (or just an header).
>         
>         >
>         > I don't know, possibly I'm missing some required .so files?
>         > I installed everything from the mono packages, and have
>         libpng
>         > installed as well.
>         
>         
>         Possible but unlikely, since you would have hit an exception
>         (or a
>         crash).
>         
>         
>         >
>         >
>         >
>         >
>         > üdvözlettel
>         > with regards
>         >
>         > Kardos Bálint
>         > _______________________________________
>         > http://skaelede.hu 10 (0xA) év a magyar weben
>         >
>         >
>         > On Wed, Feb 4, 2009 at 19:12, Sebastien Pouliot
>         > <sebastien.pouliot at gmail.com> wrote:
>         >         On Wed, 2009-02-04 at 18:55 +0100, Bálint Kardos
>         wrote:
>         >         > Hi,
>         >         >
>         >         >
>         >         > I have written a small HttpHandler which
>         automatically
>         >         generates text
>         >         > on the fly with a custom font, added to the
>         >         > System.Drawing.Font.PrivateFontCollection.
>         >         >
>         >         >
>         >         > with Ms.net 3.5sp1, it works fine.
>         >         >
>         >         >
>         >         > with Mono 2.0.1,
>         >         > on Vista, it dies with:
>         >         >
>         >         >
>         >         > Stacktrace:
>         >         >
>         >         >
>         >         >   at (wrapper managed-to-native)
>         >         >
>         System.Drawing.GDIPlus.GdipDeletePrivateFontCollection
>         >         (intptr&)
>         >         > <0x00004>
>         >         >   at (wrapper managed-to-native)
>         >         >
>         System.Drawing.GDIPlus.GdipDeletePrivateFontCollection
>         >         (intptr&)
>         >         > <0xffffffff>
>         >         >   at
>         System.Drawing.Text.PrivateFontCollection.Dispose
>         >         (bool)
>         >         > [0x00015] in C:\cygwin\tmp\monobuild\build\BUILD
>         \mono-2.0.1
>         >         \mcs\class
>         >         > \System.Drawing\System.Drawing.Text
>         >         \PrivateFontCollection.cs:80
>         >         >
>         >         >
>         >         >
>         >         >
>         >         > on Linux, it dies with:
>         >         >
>         >         >
>         >         > System.Exception: Generic Error [GDI+ status:
>         GenericError]
>         >         >   at System.Drawing.GDIPlus.CheckStatus (Status
>         status)
>         >         [0x00000]
>         >         >   at System.Drawing.Image.Save (System.String
>         filename,
>         >         System.Drawing.Imaging.ImageCodecInfo encoder,
>         >         System.Drawing.Imaging.EncoderParameters
>         encoderParams)
>         >         [0x00000]
>         >         >   at System.Drawing.Image.Save (System.String
>         filename,
>         >         System.Drawing.Imaging.ImageFormat format) [0x00000]
>         >         >
>         >         > none of the which are further traceable.
>         >
>         >
>         >         This is likely two different issues. I recall (it
>         was a
>         >         _long_ time
>         >         ago) some win32 specific behavior
>         wrt PrivateFontCollection -
>         >         explaining the first case.
>         >
>         >         I suspect the later error (on Linux) is due to
>         something else.
>         >
>         >         > Any clues on how to further debug?
>         >         > thank you,
>         >
>         >
>         >         Try to create a test case outside your HTTP handler
>         (i.e. a
>         >         small EXE).
>         >         Then use "mono --debug app.exe" to get a bit more
>         information
>         >         and fill a
>         >         bug report on http://bugzilla.novell.com
>         >
>         >         Thanks,
>         >         Sebastien
>         >
>         >
>         >
>         >
>         
>         
> 
> 



More information about the Mono-list mailing list