Subject: bug#19373: 24.4; SVG images rendered via librsvg fail at displaying non-inline bitmap images

From: YAMAMOTO Mitsuharu <[email-masked]>
Date: Thu, 18 Dec 2014 12:50:33 +0900

>>>>> On Wed, 17 Dec 2014 21:00:54 +0100, Ulf Jasper <[email-masked]> said:

> This is related to rsvg bug 596114 "image refs are relative to
> curdir, not .svg file" [2].  I just pushed a fix to master (c17c864)
> which should fix this.

I suspect it is not appropriate to refer to buffer-local variables of
the current buffer inside image loading functions:

diff --git a/src/image.c b/src/image.c
index 1a2c0e2..0bebd45 100644

[snip]

@@ -8818,7 +8822,9 @@ svg_load (struct frame *f, struct image *img)
 	  image_error ("Invalid image data `%s'", data, Qnil);
 	  return 0;
 	}
-      success_p = svg_load_image (f, img, SDATA (data), SBYTES (data));
+      original_filename = BVAR (current_buffer, filename);
+      success_p = svg_load_image (f, img, SDATA (data), SBYTES (data),
+                                  SDATA(original_filename));
     }
 
   return success_p;

Maybe SVG image descriptors should accept the property `:base-uri' or
something?

				     YAMAMOTO Mitsuharu
				[email-masked]