[Mono-bugs] [Bug 75430][Nor] New - libgdiplus fails to convert indexed image formats

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jun 30 21:11:14 EDT 2005


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 notzcoolx at yahoo.es.

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

--- shadow/75430	2005-06-30 21:11:14.000000000 -0400
+++ shadow/75430.tmp.2858	2005-06-30 21:11:14.000000000 -0400
@@ -0,0 +1,74 @@
+Bug#: 75430
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Mac OS 10.4.1
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Drawing.
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: notzcoolx at yahoo.es               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: libgdiplus fails to convert indexed image formats
+
+Description of Problem:
+In Mac OS X 10.4.1 with Mono 1.1.8.1 (from pkg of mono-project.com)
+libgdiplus fails when asked to convert from an indexed image to a 32b ARGB image.
+
+
+Steps to reproduce the problem:
+1. Compile this program:
+
+--- CUT ---
+using System;
+using System.Drawing;
+using System.Drawing.Imaging;
+
+class Texture
+{
+	public static void LoadTexture(string fileName) {
+		Bitmap bitmap = (Bitmap) Image.FromFile(fileName);
+		
+		Rectangle rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
+		BitmapData bitmapdata =
+			bitmap.LockBits(rect,
+			                ImageLockMode.ReadOnly, 
+			                PixelFormat.Format32bppArgb);
+		/* Do somenthing */
+		bitmap.UnlockBits(bitmapdata);
+		bitmap.Dispose();
+	}
+	
+	public static void Main(string[] args) {
+		LoadTexture(args[0]);
+	}
+}
+--- CUT ---
+
+2. Try it with 2 uncompressed bmp, one indexed and one 24bpp. 
+
+Actual Results:
+The test should fail in Mac with the indexed image but do not fail in Windows (.Net or Mono 
+1.1.8 (from installer)) or Linux (Mono 1.1.8 (compiled from Gentoo ebuild or SVN)).
+
+Expected Results:
+Both images get processed fine and the program exits without output or exception.
+
+
+How often does this happen?
+With all indexed images I've tried.
+
+
+Additional Information:
+The problem seems to be in libgdiplus/src/bitmap.c at gdip_bitmap_change_rect_pixel_format 
+called from GdipBitmapLockBits function. I haven't been able to compile and debug libgdiplus 
+from SVN but I think that the problem lies when that function call 
+gdip_is_pixel_format_conversion_valid (but I don't know exactly).
+I remeber that some months ago (about six) I tried the program I extracted this test in Linux and 
+also failed but since 1.1.6 or 1.1.7 it doesn't fail in Linux neither (it always worked in Windows 
+with .Net or Mono).


More information about the mono-bugs mailing list