summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-12-13 12:45:52 +0000
committerMichael Drake <mdrake.unique@gmail.com>2022-12-13 13:02:44 +0000
commitf30f869ea40ad7633ec34903d0f1594c860a32ae (patch)
tree7905bab26942e4d71f909d61344be83b006dfa5d
parent68a4cd39cdb7e57ff45aea6ad892b727851603e6 (diff)
downloadnetsurf-f30f869ea40ad7633ec34903d0f1594c860a32ae.tar.gz
netsurf-f30f869ea40ad7633ec34903d0f1594c860a32ae.tar.bz2
rsvg246: Fix build against librsvg 2.48
The version of librsvg is used on Ubuntu 20.04TLS.
-rw-r--r--content/handlers/image/rsvg246.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/content/handlers/image/rsvg246.c b/content/handlers/image/rsvg246.c
index 5c61c86ad..0e337132f 100644
--- a/content/handlers/image/rsvg246.c
+++ b/content/handlers/image/rsvg246.c
@@ -147,6 +147,7 @@ rsvg_cache_convert(struct content *c)
static void rsvg__get_demensions(const rsvg_content *svgc,
int *width, int *height)
{
+#if LIBRSVG_MAJOR_VERSION >= 2 && LIBRSVG_MINOR_VERSION >= 52
gdouble rwidth;
gdouble rheight;
gboolean gotsize;
@@ -168,7 +169,13 @@ static void rsvg__get_demensions(const rsvg_content *svgc,
*width = ink_rect.width;
*height = ink_rect.height;
}
+#else
+ RsvgDimensionData rsvgsize;
+ rsvg_handle_get_dimensions(svgc->rsvgh, &rsvgsize);
+ *width = rsvgsize.width;
+ *height = rsvgsize.height;
+#endif
NSLOG(netsurf, DEBUG, "rsvg width:%d height:%d.", *width, *height);
}