Commit 0f25da46 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

plug-ins/winicon/icoload.c applied patches from Felix Pahl. Fixes

2006-02-14  Sven Neumann  <sven@gimp.org>

	* plug-ins/winicon/icoload.c
	* plug-ins/winicon/icosave.c: applied patches from Felix Pahl.
	Fixes incorrect bit shifts that caused scrambled transparency
	(bug #330692).
parent f113420b
2006-02-14 Sven Neumann <sven@gimp.org>
* plug-ins/winicon/icoload.c
* plug-ins/winicon/icosave.c: applied patches from Felix Pahl.
Fixes incorrect bit shifts that caused scrambled transparency
(bug #330692).
2006-02-14 Sven Neumann <sven@gimp.org> 2006-02-14 Sven Neumann <sven@gimp.org>
* plug-ins/common/sparkle.c: renamed parameter from opacity to * plug-ins/common/sparkle.c: renamed parameter from opacity to
......
...@@ -263,7 +263,7 @@ ico_get_bit_from_data (const guint8 *data, ...@@ -263,7 +263,7 @@ ico_get_bit_from_data (const guint8 *data,
line = bit / line_width; line = bit / line_width;
offset = bit % line_width; offset = bit % line_width;
result = (data[line * width32 * 4 + offset/8] & (1 << (7 - (bit % 8)))); result = (data[line * width32 * 4 + offset/8] & (1 << (7 - (offset % 8))));
return (result ? 1 : 0); return (result ? 1 : 0);
} }
...@@ -285,9 +285,9 @@ ico_get_nibble_from_data (const guint8 *data, ...@@ -285,9 +285,9 @@ ico_get_nibble_from_data (const guint8 *data,
offset = nibble % line_width; offset = nibble % line_width;
result = result =
(data[line * width32 * 4 + offset/2] & (0x0F << (4 * (1 - nibble % 2)))); (data[line * width32 * 4 + offset/2] & (0x0F << (4 * (1 - offset % 2))));
if (nibble % 2 == 0) if (offset % 2 == 0)
result = result >> 4; result = result >> 4;
return result; return result;
......
...@@ -296,7 +296,7 @@ ico_set_bit_in_data (guint8 *data, ...@@ -296,7 +296,7 @@ ico_set_bit_in_data (guint8 *data,
offset = bit_num % line_width; offset = bit_num % line_width;
bit_val = bit_val & 0x00000001; bit_val = bit_val & 0x00000001;
data[line * width32 * 4 + offset/8] |= (bit_val << (7 - (bit_num % 8))); data[line * width32 * 4 + offset/8] |= (bit_val << (7 - (offset % 8)));
} }
...@@ -317,7 +317,7 @@ ico_set_nibble_in_data (guint8 *data, ...@@ -317,7 +317,7 @@ ico_set_nibble_in_data (guint8 *data,
offset = nibble_num % line_width; offset = nibble_num % line_width;
nibble_val = nibble_val & 0x0000000F; nibble_val = nibble_val & 0x0000000F;
data[line * width8 * 4 + offset/2] |= (nibble_val << (4 * (1 - (nibble_num % 2)))); data[line * width8 * 4 + offset/2] |= (nibble_val << (4 * (1 - (offset % 2))));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment