GNU bug report logs -
#55322
28.1; :base-uri not working for svg images on mac
Previous Next
Reported by: Howard Melman <hmelman <at> gmail.com>
Date: Sun, 8 May 2022 19:17:02 UTC
Severity: normal
Found in version 28.1
Done: Alan Third <alan <at> idiocy.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Please forgive this bug report, I'm a bit out of my depth on the
technologies here but I'm trying.
I found this on the macport of Emacs 28.1 but it fails in a similar
though slightly different way on vanilla emacs 28.1 -Q. from
https://emacsformacosx.com/
I only know how to reproduce this with the osm package available from
GNU ELPA or https://github.com/minad/osm This renders maps from open
street maps inside emacs. It requires the package compat.
To reproduce, load the package compat and then osm (just osm.elc) and
do M-x osm-search and enter a place with completion, I used London for
this example. In Emacs 28.1 -Q it renders as follows:
The issue is that one of the tiles isn't being rendered. osm displays an svg
location marker at the searched for location and displays the map tile
behind that. On the macport it renders as follows which I think exposes
the issue more clearly:
In Emacs 27, osm displays this tile just fine because it included
the tile image as base64 encoded data because :base-uri
functionality didn't exist. As of Emacs 28 it tries to use it
for performance reasons an apparently it works fine on
linux systems. This can be found on line 929 of osm.el
The text of the image can be obtained via (buffer-string) in
the *osm* buffer. For the above I see (with a few newlines
added for clarity)::
#("
" 0 1 (display ((slice 170 194 86 62) (image :width 256 :height 256 :file "/Users/hmelman/.emacs.d/var/osm/default/9-254-169.png" :type png)))
1 2 (display ((slice 0 194 256 62) (image :width 256 :height 256 :file "/Users/hmelman/.emacs.d/var/osm/default/9-255-169.png" :type png)))
2 3 (display ((slice 0 194 256 62) (image :width 256 :height 256 :file "/Users/hmelman/.emacs.d/var/osm/default/9-256-169.png" :type png)))
3 4 (display ((slice 0 194 256 62) (image :width 256 :height 256 :file "/Users/hmelman/.emacs.d/var/osm/default/9-257-169.png" :type png)))
5 6 (display ((slice 170 0 86 256) (image :width 256 :height 256 :file "/Users/hmelman/.emacs.d/var/osm/default/9-254-170.png" :type png)))
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>" :map (((poly . [209 64 189 24 209 14 229 24]) osm-transient (help-echo "London, Westminster, Greater London, En…" pointer hand)))
)) 7 8 (display (image :width 256 :height 256 :file "/Users/hmelman/.emacs.d/var/osm/default/9-256-170.png" :type png)) 8 9 (display (image :width 256 :height 256 :file "/Users/hmelman/.emacs.d/var/osm/default/9-257-170.png" :type png)))
The issue is the image referenced as:
xlink:href='9-255-170.png'
isn't found even though it is in the directory
/Users/hmelman/.emacs.d/var/osm/default/
Apparently this works fine on linux. I originally reported
it here: https://github.com/minad/osm/issues/23
I believe the emacs from https://emacsformacosx.com/
uses librsvg and the macport uses Webkit instead for
the rendering svg, but both fail, so I think it's in whatever
is handling :base-uri.
I don't know how to use the svg.el library but the
equivalent is apparently done via svg-embed-base-uri-image.
Is there a test case I could run via that to generate a
simpler recipe?
Can anyone else verify the use of :base-uri on a mac?
--
Howard
[Message part 2 (text/html, inline)]
[Screen Shot 2022-05-08 at 3.02.49 PM.png (image/png, inline)]
[Screen Shot 2022-05-08 at 3.03.52 PM.png (image/png, inline)]
This bug report was last modified 3 years and 17 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.