diff options
| author | Zajcev Evgeny | 2020-12-17 01:04:09 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2020-12-26 11:18:49 +0200 |
| commit | b3c9af9061e09efd94a1f5bd58aed69800da237d (patch) | |
| tree | ceb3266033e04195ab66f5417cca86c35387034e /src | |
| parent | cf1d7034445e7896c34f88256e5d7f2674a4f7ee (diff) | |
| download | emacs-b3c9af9061e09efd94a1f5bd58aed69800da237d.tar.gz emacs-b3c9af9061e09efd94a1f5bd58aed69800da237d.zip | |
Improvements for `:base-uri' svg image property
* src/image.c (svg_load): Use ENCODE_FILE for `:base-uri'
* doc/lispref/display.texi (SVG Images): Add more documentation for
`:base-uri'
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c index 29cd189f177..e99ba09f515 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -9803,8 +9803,9 @@ svg_load (struct frame *f, struct image *img) | |||
| 9803 | } | 9803 | } |
| 9804 | /* If the file was slurped into memory properly, parse it. */ | 9804 | /* If the file was slurped into memory properly, parse it. */ |
| 9805 | if (!STRINGP (base_uri)) | 9805 | if (!STRINGP (base_uri)) |
| 9806 | base_uri = ENCODE_FILE (file); | 9806 | base_uri = file; |
| 9807 | success_p = svg_load_image (f, img, contents, size, SSDATA (base_uri)); | 9807 | success_p = svg_load_image (f, img, contents, size, |
| 9808 | SSDATA (ENCODE_FILE (base_uri))); | ||
| 9808 | xfree (contents); | 9809 | xfree (contents); |
| 9809 | } | 9810 | } |
| 9810 | /* Else it's not a file, it's a Lisp object. Load the image from a | 9811 | /* Else it's not a file, it's a Lisp object. Load the image from a |
| @@ -9822,7 +9823,8 @@ svg_load (struct frame *f, struct image *img) | |||
| 9822 | if (!STRINGP (base_uri)) | 9823 | if (!STRINGP (base_uri)) |
| 9823 | base_uri = BVAR (current_buffer, filename); | 9824 | base_uri = BVAR (current_buffer, filename); |
| 9824 | success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data), | 9825 | success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data), |
| 9825 | (NILP (base_uri) ? NULL : SSDATA (base_uri))); | 9826 | (STRINGP (base_uri) ? |
| 9827 | SSDATA (ENCODE_FILE (base_uri)) : NULL)); | ||
| 9826 | } | 9828 | } |
| 9827 | 9829 | ||
| 9828 | return success_p; | 9830 | return success_p; |