[Mono-list] System.Drawing.Image Weirdness

Jordi Mas jordi@ximian.com
Fri, 13 Aug 2004 13:41:33 -0600


El divendres 13 de agost del 2004 a les 08:35 -0400, en/na Matthew
Metnetsky va escriure:
> I'm trying to use Image.FromFile within mod_mono and I keep getting the
> strangest error.  When I go to the page I get an internal server error. 
> The only code on the page is as follows
> 
> ===========
> <%@ Page Language="C#" %>
> 
> <script language="C#" runat="server">
>     protected override void OnInit(EventArgs e)
>     {
>       System.Drawing.Image img =
> System.Drawing.Image.FromFile("/home/html/devel3/u-ass/images/menus/roles.gif");
>       Response.Write(img.Height + "<br><br>-----<br>");
>       Response.Write(img.Width + "<br><br>-----<br>");
>     }
> </script>
> 
> ===========
> 
> And the console I used to start the server gets the following message:
> "X11 connection rejected because of wrong authentication".
> 
> I have no idea whats going on.  The code in a console application works
> fine, but once it hits the server it just dies.  
> 
> I'm running on the latest Mono 1.0.1 release.
> 
> Any ideas/suggestions?

Try to do 'export GDIPLUS_NOX=1' and then run the application again.
This define prevents libgdiplus (the core of System.Drawing on Linux)
from openning the current X display.

I hope it helps.

Jordi,