GNU bug report logs - #64908
29.1; svg parse failure

Previous Next

Package: emacs;

Reported by: Daniel Vianna <dmlvianna <at> gmail.com>

Date: Fri, 28 Jul 2023 01:12:02 UTC

Severity: normal

Tags: unreproducible

Found in version 29.1

Done: Alan Third <alan <at> idiocy.org>

Bug is archived. No further changes may be made.

Full log


Message #67 received at 64908 <at> debbugs.gnu.org (full text, mbox):

From: David Ponce <da_vid <at> orange.fr>
To: Alan Third <alan <at> idiocy.org>, Eli Zaretskii <eliz <at> gnu.org>,
 64908 <at> debbugs.gnu.org
Subject: Re: bug#64908: 29.1; svg parse failure
Date: Sat, 5 Aug 2023 17:53:52 +0200
On 05/08/2023 17:14, Alan Third wrote:
> On Sat, Aug 05, 2023 at 02:32:07PM +0200, David Ponce wrote:
>> On 05/08/2023 11:58, Alan Third wrote:
>> I did test your V2 patch, and it seems to work well.
>> I tend to agree with your reasoning, even if I am not enough a
>> librsvg expert to fully understand all the details.
> 
> Thanks!
> 
>> One case however is not working, when the svg image just specify
>> percentage for width and height without a viewbox, like this:
>>
>> '(image :type svg :data
>>       "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
>>    <defs id=\"defs3051\">
>>      <style type=\"text/css\" id=\"current-color-scheme\">
>>        .ColorScheme-Text {
>>          color:#232629;
>>        }
>>        </style>
>>    </defs>
>>   <path
>>      style=\"fill:currentColor;fill-opacity:1;stroke:none\"
>>      d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
>>      class=\"ColorScheme-Text\"
>>      />
>> </svg>"
>>       :scale 1)
>>
>> I can display a such image in firefox, gwenview, or inkscape, but not in Emacs.
>> I guess it works in applications that provide a default viewbox when not defined.
>> And it is failing in Emacs because no default viewbox is provided.
> 
> Very strange, it works here. rsvg_handle_get_geometry_for_layer should
> handle this fine. I wonder if something subtle has changed with
> 2.56... I can't fine anything in the documentation to say this has
> changed...
> 
> We can always provide an absolute fallback of 100x100 or something. I
> think that's what we used to do. But it would be good to know if
> something is actually broken here. Are you able to check the return
> value of rsvg_handle_get_geometry_for_layer and see if it's throwing
> up an error?

Using this image spec:

'(image :type svg :data
     "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100%\" height=\"100%\">
  <defs id=\"defs3051\">
    <style type=\"text/css\" id=\"current-color-scheme\">
      .ColorScheme-Text {
        color:#232629;
      }
      </style>
  </defs>
 <path
    style=\"fill:currentColor;fill-opacity:1;stroke:none\"
    d=\"m7.707031 3l-.707031.707031 6.125 6.125 1.167969 1.167969-1.167969 1.167969-6.125 6.125.707031.707031 6.125-6.125 1.875-1.875-1.875-1.875-6.125-6.125\"
    class=\"ColorScheme-Text\"
    />
</svg>"
     :scale 1 :width 22 :height 22)

rsvg_handle_get_geometry_for_layer returns 1, and insert-image displays
a black square of 22x22 pixels.






This bug report was last modified 1 year and 287 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.