From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pascal Quesseveur Newsgroups: gmane.emacs.bugs Subject: bug#56182: 28.1; Display of SVG file with transparent background is incorrect Date: Tue, 28 Jun 2022 20:38:11 +0200 Organization: Les Enchantements de Miraldra Message-ID: <82pmis3a7g.fsf@gmail.com> References: <82k096lgj5.fsf@gmail.com> <87a6a2s9e2.fsf@gnus.org> <83czexaycd.fsf@gnu.org> Reply-To: pquessev@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11222"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (windows-nt) Cc: Eli Zaretskii , Lars Ingebrigtsen , 56182@debbugs.gnu.org To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 28 20:39:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o6G7S-0002hz-50 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 20:39:26 +0200 Original-Received: from localhost ([::1]:46830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6G7Q-0003AK-AX for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jun 2022 14:39:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6G76-00039v-6k for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 14:39:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34196) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6G74-0002i3-UM for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 14:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6G73-0008UV-OT for bug-gnu-emacs@gnu.org; Tue, 28 Jun 2022 14:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Pascal Quesseveur Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jun 2022 18:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56182 X-GNU-PR-Package: emacs Original-Received: via spool by 56182-submit@debbugs.gnu.org id=B56182.165644152232613 (code B ref 56182); Tue, 28 Jun 2022 18:39:01 +0000 Original-Received: (at 56182) by debbugs.gnu.org; 28 Jun 2022 18:38:42 +0000 Original-Received: from localhost ([127.0.0.1]:56326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6G6W-0008Ti-Lb for submit@debbugs.gnu.org; Tue, 28 Jun 2022 14:38:42 -0400 Original-Received: from smtp6-g21.free.fr ([212.27.42.6]:14710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6G6K-0008TJ-4A for 56182@debbugs.gnu.org; Tue, 28 Jun 2022 14:38:27 -0400 Original-Received: from dagon (unknown [88.127.239.170]) (Authenticated sender: pascal.quesseveur@free.fr) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 99EA77802B2; Tue, 28 Jun 2022 20:38:11 +0200 (CEST) In-Reply-To: (Alan Third's message of "Sat, 25 Jun 2022 17:32:34 +0100") X-Attribution: PQsr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235566 Archived-At: >"AT" =3D=3D Alan Third a =E9crit=A0: AT> I can't reproduce it. >From what I understand the way to deal with background transparency of SVG images has changed in version 28.1 in function svg_load_image (comments about opacity are still there but I think they are irrelevant). Now the SVG image is encapsulated in another SVG image in which a rect element is defined with the background color of the image. I don't know why it doesn't work on the W10 computers I work on. I don't know if the problem comes from this modificatino either. It seems to me that the displayed color is BGR instead of RGB and the screen gamma correction is not applied. For what it's worth I managed to work around the problem in lisp. With version 27.1 I had implemented an advice to improve the taking into account of the background color in the style of SVG file. So I extended that advice to solve my problem. (defun qsr/create-image (orig-fun file-or-data &optional type data-p &rest = props) "Advice around create-image. When image type is SVG, look for a background color in SVG style and define this color as background property in returned image. When emacs 28 on Windows correct background color." (let ((data-format (and data-p (or (plist-get props :format) t)))) (setq type (ignore-error unknown-image-type (image-type file-or-data type data-format))) (let ((image (apply orig-fun file-or-data type data-p props)) color) (when image ;; Regexp to match ;; ...background-color::#dddddd;... (if (and (eq type 'svg) data-p (or (string-match "]*\\