emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] image: add support for specified :background on GIF


From: Julien Danjou
Subject: [PATCH 2/2] image: add support for specified :background on GIF
Date: Wed, 27 Oct 2010 16:27:33 +0200

Signed-off-by: Julien Danjou <address@hidden>
---
 src/ChangeLog |    1 +
 src/image.c   |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 3d9b6bf..65d2730 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,6 +1,7 @@
 2010-10-27  Julien Danjou  <address@hidden>
 
        * image.c (gif_load): Add support for transparency.
+       (gif_load): Add support for specified :background.
 
 2010-10-26  Juanma Barranquero  <address@hidden>
 
diff --git a/src/image.c b/src/image.c
index 8a32aaf..5bdba51 100644
--- a/src/image.c
+++ b/src/image.c
@@ -7231,7 +7231,15 @@ gif_load (struct frame *f, struct image *img)
     for (i = 0; i < gif_color_map->ColorCount; ++i)
       {
         if (transparency_color_index == i)
-          pixel_colors[i] = FRAME_BACKGROUND_PIXEL (f);
+          {
+            XColor color;
+            Lisp_Object specified_bg
+              = image_spec_value (img->spec, QCbackground, NULL);
+            if (STRINGP (specified_bg))
+              pixel_colors[i] = x_alloc_image_color (f, img, specified_bg, 
FRAME_BACKGROUND_PIXEL (f));
+            else
+              pixel_colors[i] = FRAME_BACKGROUND_PIXEL (f);
+          }
         else
           {
             int r = gif_color_map->Colors[i].Red << 8;
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]