Ensure we check for the correct minimum rsvg version for rsvg_handle_get_intrinsic_size_in_pixels

In commit cbcf5bc64a, newer librsvg APIs were used that are not available in versions between 2.36.0 and 2.50.0, e.g. rsvg_handle_get_intrinsic_size_in_pixels which was included in 2.51.x.

This has been resolved by adding a HAVE_SVG_2_51 and using it for both rsvg_handle_get_intrinsic_size_in_pixels and rsvg_handle_render_document, though the later technically landed in 2.46.0.

Reviewed-by: Christopher Michael <devilhorns@comcast.net>
Differential Revision: https://phab.enlightenment.org/D12293
This commit is contained in:
Joshua Strobl 2021-09-22 15:56:01 +00:00 committed by Christopher Michael
parent 3f1d183c06
commit ec527a9026
2 changed files with 7 additions and 2 deletions

View File

@ -99,7 +99,7 @@ read_svg_header(int scale_down, double dpi, int size_w, int size_h)
{
rsvg_handle_set_dpi(rsvg, 75.0);
#ifndef HAVE_SVG_2_36
#ifndef HAVE_SVG_2_51
rsvg_handle_get_dimensions(rsvg, &dim);
width = dim.width;
height = dim.height;
@ -162,7 +162,7 @@ read_svg_data(void)
cairo_scale(cr, (double) width / dim.em, (double) height / dim.ex);
#ifndef HAVE_SVG_2_36
#ifndef HAVE_SVG_2_51
rsvg_handle_render_cairo(rsvg, cr);
#else
RsvgRectangle vp =

View File

@ -8,5 +8,10 @@ if rsvg.version() >= '2.36.0'
config_h.set('HAVE_SVG_2_36', '1')
endif
# Needed for rsvg_handle_get_intrinsic_size_in_pixels
if rsvg.version() >= '2.51.0'
config_h.set('HAVE_SVG_2_51', '1')
endif
generic_deps = [rsvg]
generic_support = ['svg', 'svgz', 'svg.gz']