[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master f45ce78 2/2: Explicitly specify svg base_uri using `:base-uri
From: |
Eli Zaretskii |
Subject: |
Re: master f45ce78 2/2: Explicitly specify svg base_uri using `:base-uri' image property |
Date: |
Sat, 12 Dec 2020 21:42:49 +0200 |
Thank you for your contribution, but I noticed a few minor issues with
it:
> +@defun svg-embed-base-uri-image svg relative-filename &rest args
> +To @var{svg} add an embedded (raster) image placed at
> +@var{relative-filename}. @var{relative-filename} is searched inside
> +@code{file-name-directory} of the @code{:base-uri} svg image property.
This is the only place in the manual where the :base-uri attribute is
mentioned. Can we please add some minimal description of what that
attribute does and how it is useful?
> +This improves the performance of embedding large images.
What is "this" that improves the performance, and how does it do so?
We should at least hint at the improvement, without that this sentence
sounds puzzling.
> +** Can explicitly specify base_uri for svg images.
This should say
It is now possible to explicitly specify base_uri for SVG images.
Please also add a short explanation of what "base_uri" is, or point to
some canonical description on the net.
> +':base-uri' image property can be used to explicitly specify base_uri
> +for embedded images into svg. ':base-uri' is supported for both file
> +and data svg images. ^^^
Please leave 2 spaces between sentences, per our conventions.
> +** 'svg-embed-base-uri-image' added to embed images
Suggest to reword:
New function 'svg-embed-base-uri-image'.
> +(defun svg-embed-base-uri-image (svg relative-filename &rest args)
> + "Insert image placed at RELATIVE-FILENAME into the SVG structure.
"Placed" is not the word I'd use here. "Located" is better.
> @@ -9782,10 +9786,10 @@ svg_load (struct frame *f, struct image *img)
> image_error ("Invalid image data `%s'", data);
> return 0;
> }
> - original_filename = BVAR (current_buffer, filename);
> + if (!STRINGP (base_uri))
> + base_uri = BVAR (current_buffer, filename);
> success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data),
> - (NILP (original_filename) ? NULL
> - : SSDATA (original_filename)));
> + (NILP (base_uri) ? NULL : SSDATA
> (base_uri)));
Here you are passing an unencoded file name to svg_load_image, which
expects an encoded file name. (Yes, the original code was wrong as
well).
Can these minor issues be fixed, please?
- Re: master f45ce78 2/2: Explicitly specify svg base_uri using `:base-uri' image property,
Eli Zaretskii <=