summaryrefslogtreecommitdiff
path: root/image/rsvg.c
diff options
context:
space:
mode:
Diffstat (limited to 'image/rsvg.c')
-rw-r--r--image/rsvg.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/image/rsvg.c b/image/rsvg.c
index c47e9a078..02455733e 100644
--- a/image/rsvg.c
+++ b/image/rsvg.c
@@ -207,4 +207,28 @@ void rsvg_destroy(struct content *c)
return;
}
+bool rsvg_clone(const struct content *old, struct content *new_content)
+{
+ const char *data;
+ unsigned long size;
+
+ /* Simply replay create/process/convert */
+ if (rsvg_create(new_content, NULL) == false)
+ return false;
+
+ data = content__get_source_data(new_content, &size);
+ if (size > 0) {
+ if (rsvg_process_data(new_content, data, size) == false)
+ return false;
+ }
+
+ if (old->status == CONTENT_STATUS_READY ||
+ old->status == CONTENT_STATUS_DONE) {
+ if (rsvg_convert(new_content) == false)
+ return false;
+ }
+
+ return true;
+}
+
#endif /* WITH_RSVG */