forked from puppylinux-woof-CE/woof-CE
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 0fdeafa10373514fbabb1eb8dd9505cf414e1f8d Mon Sep 17 00:00:00 2001 | ||
From: Dima Krasner <dima@dimakrasner.com> | ||
Date: Sat, 4 Jun 2022 15:48:38 +0800 | ||
Subject: [PATCH] fall back to the 2.3.7 behavior when SVG image size in pixels | ||
is unknown | ||
|
||
Fixed #571. | ||
--- | ||
src/image.c | 8 ++++++++ | ||
1 file changed, 8 insertions(+) | ||
|
||
diff --git a/src/image.c b/src/image.c | ||
index 3431c8ce..a6f8f9f4 100644 | ||
--- a/src/image.c | ||
+++ b/src/image.c | ||
@@ -483,6 +483,14 @@ ImageNode *LoadSVGImage(const char *fileName, int rwidth, int rheight, | ||
} else if(has_viewbox) { | ||
dim.width = viewbox.width; | ||
dim.height = viewbox.height; | ||
+ } else if(rwidth == 0 && rheight == 0) { | ||
+#if LIBRSVG_CHECK_VERSION(2, 52, 0) | ||
+ rsvg_handle_get_intrinsic_size_in_pixels(rh, &pwidth.length, &pheight.length); | ||
+ dim.width = pwidth.length; | ||
+ dim.height = pheight.length; | ||
+#else | ||
+ rsvg_handle_get_dimensions(rh, &dim); | ||
+#endif | ||
} else { | ||
dim.width = rwidth; | ||
dim.height = rheight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters