svgload: use `rsvg_handle_get_geometry_for_element` instead (#2919)

See: https://gitlab.gnome.org/GNOME/librsvg/-/issues/853.
This commit is contained in:
Kleis Auke Wolthuizen 2022-07-12 13:33:54 +02:00 committed by GitHub
parent 8a049e9dfc
commit e1098857b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -400,7 +400,7 @@ vips_foreign_load_svg_get_natural_size( VipsForeignLoadSvg *svg,
if( !rsvg_handle_get_intrinsic_size_in_pixels( svg->page,
&width, &height ) ) {
RsvgRectangle zero_rect, viewbox;
RsvgRectangle viewbox;
/* Try the intrinsic dimensions first.
*/
@ -465,8 +465,8 @@ vips_foreign_load_svg_get_natural_size( VipsForeignLoadSvg *svg,
/* We haven't found a usable set of sizes, so try
* working out the visible area.
*/
rsvg_handle_get_geometry_for_layer( svg->page, NULL,
&zero_rect, &viewbox, NULL, NULL );
rsvg_handle_get_geometry_for_element( svg->page, NULL,
&viewbox, NULL, NULL );
width = viewbox.x + viewbox.width;
height = viewbox.y + viewbox.height;
}