summaryrefslogtreecommitdiff
path: root/test/read_png.c
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2006-02-13 16:47:01 -0800
committerCarl Worth <cworth@cworth.org>2006-02-13 16:47:01 -0800
commit6c38e238e5daab5df4c11027d28e48e62bbd4bc8 (patch)
tree150fc4b07ca1b92e8439bb722fde8bf63db7d009 /test/read_png.c
parent0b5ac24b1522b3287903c04fb894bfae4fc67403 (diff)
parent980eff38e494223de00e7ded706f6beaca27fce1 (diff)
Remove pixman from SNAPSHOT_0_4_0SNAPSHOT_0_4_0
Diffstat (limited to 'test/read_png.c')
-rw-r--r--test/read_png.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/read_png.c b/test/read_png.c
index 23f91e831..e7e2a92ca 100644
--- a/test/read_png.c
+++ b/test/read_png.c
@@ -47,9 +47,9 @@ premultiply_data (png_structp png,
unsigned char alpha = base[3];
unsigned long p;
- red = (unsigned) red * (unsigned) alpha / 255;
- green = (unsigned) green * (unsigned) alpha / 255;
- blue = (unsigned) blue * (unsigned) alpha / 255;
+ red = ((unsigned) red * (unsigned) alpha + 127) / 255;
+ green = ((unsigned) green * (unsigned) alpha + 127) / 255;
+ blue = ((unsigned) blue * (unsigned) alpha + 127) / 255;
p = (alpha << 24) | (red << 16) | (green << 8) | (blue << 0);
memcpy (base, &p, sizeof (unsigned long));
}