gtk+ r22172 - trunk/gdk-pixbuf
- From: tml svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r22172 - trunk/gdk-pixbuf
- Date: Thu, 22 Jan 2009 09:45:59 +0000 (UTC)
Author: tml
Date: Thu Jan 22 09:45:58 2009
New Revision: 22172
URL: http://svn.gnome.org/viewvc/gtk+?rev=22172&view=rev
Log:
2009-01-19 Tor Lillqvist <tml iki fi>
Bug 568305 - gdk-pixbuf mishandles BI_BITFIELDS bmps
* io-bmp.c (OneLine32): Use unsigned variables so that we can
right-shift them without risk of sign extension. Don't "reverse"
the alpha value, actually storing 0xFF-alpha, but use it as such.
Modified:
trunk/gdk-pixbuf/ChangeLog
trunk/gdk-pixbuf/io-bmp.c
Modified: trunk/gdk-pixbuf/io-bmp.c
==============================================================================
--- trunk/gdk-pixbuf/io-bmp.c (original)
+++ trunk/gdk-pixbuf/io-bmp.c Thu Jan 22 09:45:58 2009
@@ -762,7 +762,7 @@
a_rshift = context->a_bits - a_lshift;
for (i = 0; i < context->Header.width; i++) {
- int v, r, g, b, a;
+ unsigned int v, r, g, b, a;
v = src[0] | (src[1] << 8) | (src[2] << 16) | (src[3] << 24);
@@ -775,7 +775,7 @@
*pixels++ = (g << g_lshift) | (g >> g_rshift);
*pixels++ = (b << b_lshift) | (b >> b_rshift);
if (context->a_bits)
- *pixels++ = 0xff - ((a << a_lshift) | (a >> a_rshift));
+ *pixels++ = (a << a_lshift) | (a >> a_rshift);
else
*pixels++ = 0xff;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]