Author: gonzalo
Date: 2006-05-19 18:26:32 -0400 (Fri, 19 May 2006)
New Revision: 60880

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/bmpcodec.c
Log:
2006-05-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * bmpcodec.c: fix bfSize for 24bpp.



Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2006-05-19 22:16:01 UTC (rev 60879)
+++ trunk/libgdiplus/src/ChangeLog      2006-05-19 22:26:32 UTC (rev 60880)
@@ -1,5 +1,9 @@
 2006-05-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
+       * bmpcodec.c: fix bfSize for 24bpp.
+
+2006-05-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
        * bmpcodec.c: now we're able to roundtrip a 24bpp bmp file. Don't create
        the cairo surface when loading the image. Remove unused (obsolete?)
        gdip_bitmap_save_bmp().

Modified: trunk/libgdiplus/src/bmpcodec.c
===================================================================
--- trunk/libgdiplus/src/bmpcodec.c     2006-05-19 22:16:01 UTC (rev 60879)
+++ trunk/libgdiplus/src/bmpcodec.c     2006-05-19 22:26:32 UTC (rev 60880)
@@ -1114,7 +1114,14 @@
        byte                    *scan0;
 
        activebmp = image->active_bitmap;
-       bitmapLen = activebmp->stride * activebmp->height;
+       if (activebmp->pixel_format != Format24bppRgb) {
+               bitmapLen = activebmp->stride * activebmp->height;
+       } else {
+               bitmapLen = activebmp->width * 3;
+               bitmapLen += 3;
+               bitmapLen &= ~3;
+               bitmapLen *= activebmp->height;
+       }
 
         if (activebmp->palette) {
                 colours = activebmp->palette->Count;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to