diff options
author | Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp> | 2014-08-17 18:41:54 +0200 |
---|---|---|
committer | Christian Persch <chpe@gnome.org> | 2014-08-17 18:44:36 +0200 |
commit | a35216a93b1db4973056426edc282c4decc2538a (patch) | |
tree | b6aba21db3a92d5dbbdbea47e3ff100aa1d3d96c /rsvg-convert.c | |
parent | 6873a0a18f66ef488e536c4b349ea694e8764d13 (diff) | |
download | librsvg-a35216a93b1db4973056426edc282c4decc2538a.tar.gz |
all: Add flag to keep image data2.40.3
And use it when converting to a PDF in rsvg-convert.
https://bugzilla.gnome.org/show_bug.cgi?id=721354
Diffstat (limited to 'rsvg-convert.c')
-rw-r--r-- | rsvg-convert.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/rsvg-convert.c b/rsvg-convert.c index 276e7891..b3d35759 100644 --- a/rsvg-convert.c +++ b/rsvg-convert.c @@ -102,6 +102,8 @@ main (int argc, char **argv) char *background_color_str = NULL; gboolean using_stdin = FALSE; gboolean unlimited = FALSE; + gboolean keep_image_data = FALSE; + gboolean no_keep_image_data = FALSE; GError *error = NULL; int i; @@ -138,6 +140,8 @@ main (int argc, char **argv) {"background-color", 'b', 0, G_OPTION_ARG_STRING, &background_color_str, N_("set the background color [optional; defaults to None]"), N_("[black, white, #abccee, #aaa...]")}, {"unlimited", 'u', 0, G_OPTION_ARG_NONE, &unlimited, N_("Allow huge SVG files"), NULL}, + {"keep-image-data", 0, 0, G_OPTION_ARG_NONE, &keep_image_data, N_("Keep image data"), NULL}, + {"no-keep-image-data", 0, 0, G_OPTION_ARG_NONE, &no_keep_image_data, N_("Don't keep image data"), NULL}, {"version", 'v', 0, G_OPTION_ARG_NONE, &bVersion, N_("show version information"), NULL}, {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &args, NULL, N_("[FILE...]")}, {NULL} @@ -187,6 +191,11 @@ main (int argc, char **argv) exit (1); } + if (format != NULL && + (g_str_equal (format, "ps") || g_str_equal (format, "eps") || g_str_equal (format, "pdf")) && + !no_keep_image_data) + keep_image_data = TRUE; + if (zoom != 1.0) x_zoom = y_zoom = zoom; @@ -195,6 +204,9 @@ main (int argc, char **argv) if (unlimited) flags |= RSVG_HANDLE_FLAG_UNLIMITED; + if (keep_image_data) + flags |= RSVG_HANDLE_FLAG_KEEP_IMAGE_DATA; + for (i = 0; i < n_args; i++) { GFile *file; GInputStream *stream; |