emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8ff7004 1/2: Revert "Explicitly specify svg base_uri using `:base


From: Alan Third
Subject: master 8ff7004 1/2: Revert "Explicitly specify svg base_uri using `:base-uri' image property"
Date: Sat, 12 Dec 2020 07:48:47 -0500 (EST)

branch: master
commit 8ff70045c371253b3c2c22c4f62bd9f911bccd51
Author: Alan Third <alan@idiocy.org>
Commit: Alan Third <alan@idiocy.org>

    Revert "Explicitly specify svg base_uri using `:base-uri' image property"
    
    This reverts commit a8e2143a5c03785742464406306fda7fce6caf04.
    
    I applied the incorrect version of the patch.
---
 src/image.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/image.c b/src/image.c
index bc354c1..54380d1 100644
--- a/src/image.c
+++ b/src/image.c
@@ -9743,11 +9743,10 @@ static bool
 svg_load (struct frame *f, struct image *img)
 {
   bool success_p = 0;
-  Lisp_Object file_name, base_uri;
+  Lisp_Object file_name;
 
   /* If IMG->spec specifies a file name, create a non-file spec from it.  */
   file_name = image_spec_value (img->spec, QCfile, NULL);
-  base_uri = image_spec_value (img->spec, QCbase_uri, NULL);
   if (STRINGP (file_name))
     {
       int fd;
@@ -9767,16 +9766,15 @@ svg_load (struct frame *f, struct image *img)
          return 0;
        }
       /* If the file was slurped into memory properly, parse it.  */
-      if (!STRINGP (base_uri))
-        base_uri = ENCODE_FILE (file);
-      success_p = svg_load_image (f, img, contents, size, SSDATA (base_uri));
+      success_p = svg_load_image (f, img, contents, size,
+                                 SSDATA (ENCODE_FILE (file)));
       xfree (contents);
     }
   /* Else it's not a file, it's a Lisp object.  Load the image from a
      Lisp object rather than a file.  */
   else
     {
-      Lisp_Object data;
+      Lisp_Object data, original_filename;
 
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
@@ -9784,10 +9782,10 @@ svg_load (struct frame *f, struct image *img)
          image_error ("Invalid image data `%s'", data);
          return 0;
        }
-      if (!STRINGP (base_uri))
-        base_uri = BVAR (current_buffer, filename);
+      original_filename = BVAR (current_buffer, filename);
       success_p = svg_load_image (f, img, SSDATA (data), SBYTES (data),
-                                  (NILP (base_uri) ? NULL : SSDATA 
(base_uri)));
+                                  (NILP (original_filename) ? NULL
+                                  : SSDATA (original_filename)));
     }
 
   return success_p;
@@ -9888,7 +9886,6 @@ svg_load_image (struct frame *f, struct image *img, char 
*contents,
                            FRAME_DISPLAY_INFO (f)->resy);
 
   /* Set base_uri for properly handling referenced images (via 'href').
-     Can be explicitly specified using `:base_uri' image property.
      See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
      <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
   if (filename)
@@ -10061,7 +10058,6 @@ svg_load_image (struct frame *f, struct image *img, 
char *contents,
                            FRAME_DISPLAY_INFO (f)->resy);
 
   /* Set base_uri for properly handling referenced images (via 'href').
-     Can be explicitly specified using `:base_uri' image property.
      See rsvg bug 596114 - "image refs are relative to curdir, not .svg file"
      <https://gitlab.gnome.org/GNOME/librsvg/issues/33>. */
   if (filename)
@@ -10744,7 +10740,6 @@ non-numeric, there is no explicit limit on the size of 
images.  */);
 
 #if defined (HAVE_RSVG)
   DEFSYM (Qsvg, "svg");
-  DEFSYM (QCbase_uri, ":base-uri");
   add_image_type (Qsvg);
 #ifdef HAVE_NTGUI
   /* Other libraries used directly by svg code.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]