From 505c80623049d9e181918acdac8229c9a2041b1e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 6 Oct 2023 01:54:12 +0200 Subject: [PATCH] Revert slurp_image extraction for svg_load * src/image.c (svg_load): Inline slurp_image code again, as it didn't build in its current form. Reported by Andreas Schwab . --- src/image.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/image.c b/src/image.c index fcae13e2302..9a465f0b180 100644 --- a/src/image.c +++ b/src/image.c @@ -11684,11 +11684,22 @@ svg_load (struct frame *f, struct image *img) base_uri = image_spec_value (img->spec, QCbase_uri, NULL); if (STRINGP (file_name)) { + image_fd fd; + Lisp_Object file = image_find_image_fd (file_name, &fd); + if (!STRINGP (file)) + { + image_not_found_error (file_name); + return false; + } + + /* Read the entire file into memory. */ ptrdiff_t size; - char *contents = slurp_image (file_name, &size, "SVG"); + char *contents = slurp_file (fd, &size); if (contents == NULL) - return false; - + { + image_error ("Error loading SVG image `%s'", file); + return false; + } /* If the file was slurped into memory properly, parse it. */ if (!STRINGP (base_uri)) base_uri = file; -- 2.39.2