summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-02-19 22:05:48 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-02-19 22:05:48 +0000
commitbddd4ca943cfb966f965d71cbcae9c71dc21ce41 (patch)
treebc6ecc84df1fc2eefabb384cc52c6c8529cae4e8 /gdk-pixbuf
parent797d34544629c1d3e7ce1a2dceffda4c900a8aed (diff)
downloadgdk-pixbuf-bddd4ca943cfb966f965d71cbcae9c71dc21ce41.tar.gz
Fix error in scale factors for non-alpha case.
2000-02-19 Owen Taylor <otaylor@redhat.com> * gdk-pixbuf/pixops/pixops.c (scale_pixel): Fix error in scale factors for non-alpha case.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog5
-rw-r--r--gdk-pixbuf/pixops/pixops.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index a19b927df..d3b6f0805 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,8 @@
+2000-02-19 Owen Taylor <otaylor@redhat.com>
+
+ * gdk-pixbuf/pixops/pixops.c (scale_pixel): Fix error in
+ scale factors for non-alpha case.
+
2000-02-14 Mark Crichton <crichton@gimp.org>
* gdk-pixbuf/io-xpm.c (xpm_extract_color): Added check for "g" color type.
diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c
index d6646cfcd..80246505d 100644
--- a/gdk-pixbuf/pixops/pixops.c
+++ b/gdk-pixbuf/pixops/pixops.c
@@ -672,9 +672,9 @@ scale_pixel (art_u8 *dest, int dest_x, int dest_channels, int dest_has_alpha,
}
else
{
- dest[0] = r >> 16;
- dest[1] = g >> 16;
- dest[2] = b >> 16;
+ dest[0] = (r + 0xffffff) >> 24;
+ dest[1] = (g + 0xffffff) >> 24;
+ dest[2] = (b + 0xffffff) >> 24;
if (dest_has_alpha)
dest[3] = 0xff;
@@ -755,9 +755,9 @@ scale_line (int *weights, int n_x, int n_y,
}
}
- dest[0] = r >> 16;
- dest[1] = g >> 16;
- dest[2] = b >> 16;
+ dest[0] = (r + 0xffff) >> 16;
+ dest[1] = (g + 0xffff) >> 16;
+ dest[2] = (b + 0xffff) >> 16;
if (dest_has_alpha)
dest[3] = 0xff;