Subject: Re: bug#55322: 28.1; :base-uri not working for svg images on mac

From: Alan Third <[email-masked]>
Date: Mon, 9 May 2022 22:42:00 +0100

On Sun, May 08, 2022 at 03:16:02PM -0400, Howard Melman wrote:
> 6 7 (display (image :width 256 :height 256 :type svg :base-uri "/Users/hmelman/.emacs.d/var/osm/default/9-255-170.png" :data "<svg width='256' height='256' version='1.1'
> xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
> <image xlink:href='9-255-170.png' height='256' width='256'/>
> <g fill='#08f' stroke='#028' stroke-width='9' transform='translate(209 64) scale(0.09) translate(-256 -512)'>
> <path d='M256 0C167.641 0 96 71.625 96 160c0 24.75 5.625 48.219 15.672
> 69.125C112.234 230.313 256 512 256 512l142.594-279.375
> C409.719 210.844 416 186.156 416 160C416 71.625 344.375
> 0 256 0z M256 256c-53.016 0-96-43-96-96s42.984-96 96-96
> c53 0 96 43 96 96S309 256 256 256z'/>
> </g></svg>"

The above image should be able to be replicated with something like
this below:

(insert-image (create-image "<svg width='256' height='256' version='1.1'                      
xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'>
<image xlink:href='9-255-170.png' height='256' width='256'/>
<g fill='#08f' stroke='#028' stroke-width='9'
 transform='translate(209 64) scale(0.09) translate(-256 -512)'>
<path d='M256 0C167.641 0 96 71.625 96 160c0 24.75 5.625 48.219 15.672
 69.125C112.234 230.313 256 512 256 512l142.594-279.375
 C409.719 210.844 416 186.156 416 160C416 71.625 344.375
 0 256 0z M256 256c-53.016 0-96-43-96-96s42.984-96 96-96
 c53 0 96 43 96 96S309 256 256 256z'/></g></svg>"
                            'svg t :width 256 :height 256
:base-uri "/Users/hmelman/.emacs.d/var/osm/default/9-255-170.png"))

Try messing with the base-uri, perhaps try setting it to the
directory, or to foo.svg or something.

My first guess would be that if it's working on GNU/Linux but not
macOS is that there might be a difference in the version of librsvg.
The way Emacs handles SVG files on both is pretty much identical
afaik, so any difference is likely to be down to librsvg.

-- 
Alan Third