[Mono-bugs] [Bug 81674][Wis] New - pngcodec.c upsampling patch

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri May 18 13:34:33 EDT 2007


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 mugenjouchan at gmail.com.

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

--- shadow/81674	2007-05-18 13:34:33.000000000 -0400
+++ shadow/81674.tmp.25249	2007-05-18 13:34:33.000000000 -0400
@@ -0,0 +1,53 @@
+Bug#: 81674
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: libgdiplus
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: mugenjouchan at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: pngcodec.c upsampling patch
+
+Description of Problem:
+In 1.2.3 and continuing on in the new 1.2.4 of libgdiplus there is a nice
+code for upsampling 2bpp .png files to 4bpp Bitmaps. Unfortunately there is
+one line missing to make it useful.
+
+this is the variant I used which works for me, somebody who knows the code
+might set bit_depth = 4 some lines earlier, as there is another code that
+checks if bit_depth == 4 above, I was not sure if executing that block
+would be better. 
+
+diff -ur libgdiplus-1.2.3/src/pngcodec.c libgdiplus-1.2.3-fixed/src/pngcodec.c
+--- libgdiplus-1.2.3/src/pngcodec.c     2007-01-25 07:04:39.000000000 +0100
++++ libgdiplus-1.2.3-fixed/src/pngcodec.c 2007-05-15 21:14:27.000000000 +0200
+@@ -385,6 +385,7 @@
+
+                switch (bit_depth) {
+                        case 1: result->active_bitmap->pixel_format =
+Format1bppIndexed; result->cairo_format = CAIRO_FORMAT_A1; break;
++                       case 2: result->active_bitmap->pixel_format =
+Format4bppIndexed; result->cairo_format = CAIRO_FORMAT_A8; break;
+                        case 4: result->active_bitmap->pixel_format =
+Format4bppIndexed; result->cairo_format = CAIRO_FORMAT_A8; break;
+                        case 8: result->active_bitmap->pixel_format =
+Format8bppIndexed; result->cairo_format = CAIRO_FORMAT_A8; break;
+                }
+
+Actual Results:
+a Bitmap with format DontCare, which throws misc. Exceptions on at least
+.Save, .GetPixel, .LockBits,
+
+Expected Results:
+a working Bitmap-object with the 4bpp Format
+
+How often does this happen? 
+always


More information about the mono-bugs mailing list