From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel Subject: [PATCH 2/2] image: add support for specified :background on GIF Date: Wed, 27 Oct 2010 17:00:51 +0200 Message-ID: <1288191651-3958-2-git-send-email-julien@danjou.info> References: NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1288195706 8771 80.91.229.12 (27 Oct 2010 16:08:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Oct 2010 16:08:26 +0000 (UTC) Cc: Julien Danjou To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 27 18:08:25 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PB8Y3-0008SX-IU for ged-emacs-devel@m.gmane.org; Wed, 27 Oct 2010 18:08:24 +0200 Original-Received: from localhost ([127.0.0.1]:41062 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PB8Y1-0008PA-1U for ged-emacs-devel@m.gmane.org; Wed, 27 Oct 2010 12:08:21 -0400 Original-Received: from [140.186.70.92] (port=42377 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PB8DB-0002x0-LR for emacs-devel@gnu.org; Wed, 27 Oct 2010 11:46:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PB7Uk-0008Tu-9U for emacs-devel@gnu.org; Wed, 27 Oct 2010 11:01:08 -0400 Original-Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]:57242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PB7Uk-0008Ta-1x for emacs-devel@gnu.org; Wed, 27 Oct 2010 11:00:54 -0400 Original-Received: from cigue.easter-eggs.fr (cigue.easter-eggs.fr [10.0.0.33]) by rose.easter-eggs.fr (Postfix) with ESMTPS id E88E01425C; Wed, 27 Oct 2010 17:00:49 +0200 (CEST) Original-Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1PB7Uj-00012P-EL; Wed, 27 Oct 2010 17:00:53 +0200 X-Mailer: git-send-email 1.7.2.3 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132144 Archived-At: Signed-off-by: Julien Danjou --- src/ChangeLog | 1 + src/image.c | 9 ++++++++- 2 files changed, 9 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 * image.c (gif_load): Add support for transparency. + (gif_load): Add support for specified :background. 2010-10-26 Juanma Barranquero diff --git a/src/image.c b/src/image.c index e9b85fa..ef6a6d0 100644 --- a/src/image.c +++ b/src/image.c @@ -7235,7 +7235,14 @@ gif_load (struct frame *f, struct image *img) for (i = 0; i < gif_color_map->ColorCount; ++i) { if (transparent_p && transparency_color_index == i) - pixel_colors[i] = FRAME_BACKGROUND_PIXEL (f); + { + 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