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 16:27:33 +0200 Message-ID: <1288189653-904-2-git-send-email-julien@danjou.info> References: <1288189653-904-1-git-send-email-julien@danjou.info> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1288190816 16396 80.91.229.12 (27 Oct 2010 14:46:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Oct 2010 14:46:56 +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 16:46:54 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 1PB7HB-0004EM-Oq for ged-emacs-devel@m.gmane.org; Wed, 27 Oct 2010 16:46:54 +0200 Original-Received: from localhost ([127.0.0.1]:36167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PB7HA-00010a-9H for ged-emacs-devel@m.gmane.org; Wed, 27 Oct 2010 10:46:52 -0400 Original-Received: from [140.186.70.92] (port=50937 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PB6zX-0004Yd-Fo for emacs-devel@gnu.org; Wed, 27 Oct 2010 10:29:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PB6ya-0000uk-4X for emacs-devel@gnu.org; Wed, 27 Oct 2010 10:28:26 -0400 Original-Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]:45479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PB6yZ-0000uI-Vn for emacs-devel@gnu.org; Wed, 27 Oct 2010 10:27:40 -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 6931D1425C; Wed, 27 Oct 2010 16:27:34 +0200 (CEST) Original-Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1PB6yX-0000FA-Nd; Wed, 27 Oct 2010 16:27:37 +0200 X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1288189653-904-1-git-send-email-julien@danjou.info> 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:132141 Archived-At: Signed-off-by: Julien Danjou --- 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 * 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 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