[Mono-bugs] [Bug 78763][Blo] New - System.Drawing GetThumbnailImage Error

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jul 4 17:13:43 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by esanchezfo at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=78763

--- shadow/78763	2006-07-04 17:13:43.000000000 -0400
+++ shadow/78763.tmp.30895	2006-07-04 17:13:43.000000000 -0400
@@ -0,0 +1,196 @@
+Bug#: 78763
+Product: Mono: Runtime
+Version: 1.1
+OS: SUSE 9.2
+OS Details: Suse 10.0 x86
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: io-layer
+AssignedTo: dick at ximian.com                            
+ReportedBy: esanchezfo at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Drawing GetThumbnailImage Error
+
+Trying to use tumbnail generator with System.Drawing in order to build
+tumbnails (temp folder) to use it in web pages (http://www.tierrarc.com)
+over Mono 1.15 with this code:
+
+
+public void ProcessRequest (HttpContext context)
+{
+	string requestPageName;
+	string imagePath;
+
+	System.Drawing.Image fullSizeImage;
+	System.Drawing.Image tumbnailImage;
+
+	int tumbnailImageWidth;
+	int tumbnailImageHeight;
+
+
+	requestPageName = System.IO.Path.GetFileName (context.Request.Path);
+
+	try
+	{
+		if (requestPageName == "ImageResizer.imgx")
+		{
+			if (context.Request.QueryString.Get ("ImagePath") == null)
+		{
+			throw new ArgumentException ("Is not in Request", "ImagePath [GET]");
+		}
+
+		imagePath = context.Request.QueryString ["ImagePath"];
+
+		if (imagePath.StartsWith (".") || imagePath.StartsWith ("/"))
+		{
+			throw new ArgumentException ("Wrong", "ImagePath [GET]");
+		}
+
+		if (context.Request.QueryString.Get ("ImageWidth") == null)
+		{
+			throw new ArgumentException ("Is not in Request", "ImageWidth [GET]");
+		}
+
+		if (context.Request.QueryString.Get ("ImageHeight") == null)
+		{
+			throw new ArgumentException ("Is not in Request", "ImageHeight [GET]");
+		}
+
+		tumbnailImageWidth = int.Parse (context.Request.QueryString ["ImageWidth"]);
+		tumbnailImageHeight = int.Parse (context.Request.QueryString
+["ImageHeight"]);
+
+		fullSizeImage = System.Drawing.Image.FromFile (context.Server.MapPath
+("../../" + imagePath));
+
+		context.Response.ContentType = "image/gif";					
+		tumbnailImage = 						fullSizeImage.GetThumbnailImage (
+		tumbnailImageWidth, tumbnailImageHeight,
+		new System.Drawing.Image.GetThumbnailImageAbort (ThumbnailCallback),
+IntPtr.Zero);
+
+		tumbnailImage.Save (context.Response.OutputStream, ImageFormat.Gif);
+	}
+	else
+	{
+		throw new ArgumentException (string.Format ("The Page {0} is not
+registered", requestPageName));
+	}
+}
+catch (Exception ex)
+{
+	throw new HttpException (404, string.Format ("Image File Not found: {0}",
+ex.Message + ex.StackTrace));
+}
+}
+
+Causes this error:
+
+=================================================================
+Got a SIGSEGV while executing native code. This usually indicates
+a fatal error in the mono runtime or one of the native libraries
+used by your application.
+=================================================================
+
+Stacktrace:
+
+in (wrapper managed-to-native)
+System.Runtime.InteropServices.Marshal:PtrToStringUni (intptr) <0x4>
+in (wrapper managed-to-native)
+System.Runtime.InteropServices.Marshal:PtrToStringUni (intptr) <0xfffffea4>
+in System.Drawing.GdipImageCodecInfo:MarshalTo
+(System.Drawing.GdipImageCodecInfo,System.Drawing.Imaging.ImageCodecInfo)
+<0x44>
+in System.Drawing.Imaging.ImageCodecInfo:GetImageEncoders () <0x1c4>
+in System.Drawing.Image:findEncoderForFormat
+(System.Drawing.Imaging.ImageFormat) <0x36>
+in System.Drawing.Image:Save
+(System.IO.Stream,System.Drawing.Imaging.ImageFormat) <0x19>
+in (wrapper remoting-invoke-with-check) System.Drawing.Image:Save
+(System.IO.Stream,System.Drawing.Imaging.ImageFormat) <0xffffcdac>
+in esanchezfo.WebTools.Image.ImageHandler:ProcessRequest
+(System.Web.HttpContext) <0x3cc>
+in <Pipeline>__2:MoveNext () <0x1922>
+in System.Web.HttpApplication:Tick () <0x1f>
+in System.Web.HttpApplication:Start (object) <0xdc>
+in
+System.Web.HttpApplication:System.Web.IHttpAsyncHandler.BeginProcessRequest
+(System.Web.HttpContext,System.AsyncCallback,object) <0x68>
+in System.Web.HttpRuntime:RealProcessRequest (object) <0x1a8>
+in System.Web.HttpRuntime:ProcessRequest (System.Web.HttpWorkerRequest) <0x2c>
+in Mono.WebServer.MonoWorkerRequest:ProcessRequest () <0xa>
+in Mono.WebServer.BaseApplicationHost:ProcessRequest
+(Mono.WebServer.MonoWorkerRequest) <0x43>
+in Mono.WebServer.XSPApplicationHost:ProcessRequest
+(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
+<0x37f>
+in (wrapper remoting-invoke-with-check)
+Mono.WebServer.XSPApplicationHost:ProcessRequest
+(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
+<0xfffffab2>
+in (wrapper xdomain-dispatch)
+Mono.WebServer.XSPApplicationHost:ProcessRequest
+(object,byte[]&,byte[]&,int,long,int,long,int,string,string,string,string,byte[],string)
+<0xfffe7d1e>
+in (wrapper xdomain-invoke)
+Mono.WebServer.XSPApplicationHost:ProcessRequest
+(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
+<0xffffff3d>
+in (wrapper remoting-invoke-with-check)
+Mono.WebServer.XSPApplicationHost:ProcessRequest
+(int,long,int,long,int,string,string,string,string,byte[],string,intptr,Mono.WebServer.SslInformations)
+<0xffbbb943>
+in Mono.WebServer.XSPWorker:InnerRun (object) <0x563>
+in Mono.WebServer.XSPWorker:Run (object) <0x22>
+in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_object
+(object) <0xffffff95>
+in (wrapper runtime-invoke) System.Object:runtime_invoke_void_object
+(object,intptr,intptr,intptr) <0xc7303a0f>
+
+Native stacktrace:
+
+        /usr/bin/mono(mono_handle_native_sigsegv+0xbb) [0x8153d0b]
+        /usr/bin/mono [0x813e66f]
+        [0xffffe440]
+        [0x4166823c]
+        [0x416680bd]
+        [0x41667b8d]
+        [0x4166776f]
+        [0x4166767a]
+        [0x41667620]
+        [0x4166437d]
+        [0x413c3923]
+        [0x413c0990]
+        [0x413b974d]
+        [0x413b9589]
+        [0x413b3d11]
+        [0x413b3835]
+        [0x413b37f3]
+        [0x413b3574]
+        [0x41288b50]
+        [0x41287f01]
+        [0x4128784b]
+        [0x4126f25f]
+        [0x4126f076]
+        [0x40e2a8bc]
+        [0x40e3ac2b]
+        [0x40e3abe4]
+        [0x40e3ab3e]
+        /usr/bin/mono [0x813e520]
+        /usr/bin/mono(mono_runtime_invoke+0x27) [0x80d7b67]
+        /usr/bin/mono(mono_runtime_invoke_array+0x270) [0x80d9050]
+        /usr/bin/mono(mono_message_invoke+0xc5) [0x80dac15]
+        /usr/bin/mono [0x80a611f]
+        /usr/bin/mono [0x80a6949]
+        /usr/bin/mono [0x809a922]
+        /usr/bin/mono [0x80f6ef7]
+        /usr/bin/mono [0x8115ba5]
+        /lib/tls/libpthread.so.0 [0x400cfaa7]
+        /lib/tls/libc.so.6(__clone+0x5e) [0x401c2c2e]
+
+Thanks.


More information about the mono-bugs mailing list