]> git.eshelyaron.com Git - emacs.git/commitdiff
More-robust svg_load_image fallback
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 3 Dec 2021 17:47:22 +0000 (09:47 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 3 Dec 2021 18:25:09 +0000 (10:25 -0800)
Suggested by Alan Third (Bug#44655#56).
* src/image.c (svg_load_image): Fall back on
rsvg_handle_get_geometry_for_layer if the
rsvg_handle_get_intrinsic_dimensions computations yielded unusable
viewbox width and height, instead of falling back only if
rsvg_handle_get_intrinsic_dimensions did not report image width
and height, or did not report a viewbox.

src/image.c

index f2597f529d1d06f284716a9cb72bf77d3816dc79..f13304912c8132eb8dbb908ac3348d9250423637 100644 (file)
@@ -10484,6 +10484,9 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
       viewbox_height = viewbox.height;
     }
   else
+    viewbox_width = viewbox_height = 0;
+
+  if (viewbox_width == 0 || viewbox_height == 0)
     {
       /* We haven't found a usable set of sizes, so try working out
          the visible area.  */