[Mono-bugs] [Bug 55934][Nor] Changed - Error loading image

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 12 May 2004 13:37:24 -0400 (EDT)


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 miguel@ximian.com.

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

--- shadow/55934	2004-03-24 17:12:27.000000000 -0500
+++ shadow/55934.tmp.7965	2004-05-12 13:37:24.000000000 -0400
@@ -5,13 +5,13 @@
 OS Details: Redhat 9.0
 Status: NEW   
 Resolution: 
 Severity: Unknown
 Priority: Normal
 Component: Sys.Drawing.
-AssignedTo: mono-bugs@ximian.com                            
+AssignedTo: jordi@ximian.com                            
 ReportedBy: david.mitchell@telogis.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
 Summary: Error loading image
@@ -67,6 +67,42 @@
 ------- Additional Comments From david.mitchell@telogis.com  2004-03-24 17:12 -------
 I've tried running through with various different types of image (bmp
 and jpg) and different settings (indexed, rgb, and different jpg
 sampling modes). All work fine or throw not implemented exceptions so
 that is fine. Looks like it is a png thing. The png I originally
 submitted is 4-bit btw.
+
+------- Additional Comments From miguel@ximian.com  2004-05-12 13:37 -------
+There are a number of bugs here:
+
+* The codecs *might* not return a valid image, and we blindly
+assign values to things without checking for a valid result:
+
+from libgdiplus/src/image.c:
+
+        case BMP:
+            status = gdip_load_bmp_image_from_file (fp, &result);
+            result->format = BMP;
+            break;
+        case TIF:
+            status = gdip_load_tiff_image_from_file (fp, &result);
+            result->format = TIF;
+            break;
+        case GIF:
+            status = gdip_load_gif_image_from_file (fp, &result);
+                printf("\n image.c load image from gif file, status is
+%d ", status);
+            result->format = GIF;
+            break;
+        case PNG:
+            status = gdip_load_png_image_from_file (fp, &result);
+            result->format = PNG;
+            break;
+        case JPEG:
+            status = gdip_load_jpeg_image_from_file (fp, &result);
+            result->format = JPEG;
+            break;
+
+I added checks there, so that should help things.
+
+The second step is to fix the PNG loader to cope with the 4 bit 
+thing that is on this sample.