From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#44065: 28.0.50; SVG image not shown completely Date: Mon, 19 Oct 2020 00:13:23 +0100 Message-ID: <20201018231323.GE1166@breton.holly.idiocy.org> References: <87pn5ga0wt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27328"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44065@debbugs.gnu.org To: styang@fastmail.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 19 01:14:13 2020 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 1kUHsS-00070S-Ra for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Oct 2020 01:14:12 +0200 Original-Received: from localhost ([::1]:39538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUHsR-0006en-Cx for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Oct 2020 19:14:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUHsJ-0006eN-1m for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 19:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56039) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kUHsI-0002FO-LV for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 19:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kUHsI-0001lw-Gp for bug-gnu-emacs@gnu.org; Sun, 18 Oct 2020 19:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Oct 2020 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44065 X-GNU-PR-Package: emacs Original-Received: via spool by 44065-submit@debbugs.gnu.org id=B44065.16030628126760 (code B ref 44065); Sun, 18 Oct 2020 23:14:02 +0000 Original-Received: (at 44065) by debbugs.gnu.org; 18 Oct 2020 23:13:32 +0000 Original-Received: from localhost ([127.0.0.1]:39351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUHrn-0001kx-Sw for submit@debbugs.gnu.org; Sun, 18 Oct 2020 19:13:32 -0400 Original-Received: from idiocy.org ([217.169.17.33]:52339 helo=breton.holly.idiocy.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kUHrm-0001kj-5O for 44065@debbugs.gnu.org; Sun, 18 Oct 2020 19:13:30 -0400 Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 996FC202624D51; Mon, 19 Oct 2020 00:13:23 +0100 (BST) Mail-Followup-To: Alan Third , styang@fastmail.com, 44065@debbugs.gnu.org Content-Disposition: inline In-Reply-To: <87pn5ga0wt.fsf@gmail.com> 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:190929 Archived-At: On Sat, Oct 17, 2020 at 06:27:30PM -0500, styang@fastmail.com wrote: > Emacs stopped showing SVG files completely (i.e. it is shown > cropped), with 8f42b94fe43 the offending commit. This commit intends > to resolve bug#40845. > > Please find the SVG file (1.svg) I use and the render image (1.png) > in attachment. Notice the cropped part at the bottom and on the > right side. The SVG file can be correctly viewed by Emacs 27, and > other photo viewers like eog or gThumb. The file attached embeds an > SVG element inside another, which seems to be discouraged by > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40845#68. However, > according to Mozilla MDN > (https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg), > > > The svg element is a container that defines a new coordinate > > system and viewport. It is used as the outermost element of SVG > > documents, but it can also be used to embed an SVG fragment inside > > an SVG or HTML document. I think you've misunderstood my message in that bug thread. Emacs can't blindly embed SVG files within other SVGs because we can't guarantee the files will only contain the ... section. There may be other bits, specifically XML doctype declarations, that cannot be inserted inside an SVG. It appears that by adding the wrapper SVG we change the scale of the image even though we're not asking to. I can't see what we're doing wrong. I tried switching from using rsvg_handle_get_dimensions since it uses a deprecated struct, although the function itself isn't deprecated (shades of Apple's APIs). However rsvg_handle_get_geometry_for_layer just plain doesn't return anything for at least one of my test SVG files and still seems to produce the wrong values for the viewport dimensions. It's getting late. I suppose I'll come back to this tomorrow. -- Alan Third