diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | rsvg.1 | 5 | ||||
-rw-r--r-- | test-rsvg.c | 23 |
4 files changed, 26 insertions, 11 deletions
@@ -1,3 +1,10 @@ +2004-07-12 Dom Lachowicz <cinamod@hotmail.com> + + * rsvg.1: Update documentation + * configure.in: Fix build + * test-rsvg.c: Refactor a bit - allow for saving to ICO or anything + else that GdkPixbuf supports + 2004-07-10 Dom Lachowicz <cinamod@hotmail.com> * *.c: Allow for different X & Y resolutions (DPI). This needs more work; diff --git a/configure.in b/configure.in index 6452054e..2e8f01a4 100644 --- a/configure.in +++ b/configure.in @@ -316,7 +316,7 @@ if test "x$MOZILLA_CONFIG" != "xno"; then MOZILLA_CFLAGS="-I$_mozilla_include_dir/plugin -I$_mozilla_include_dir/java -I$_mozilla_include_dir/nspr" else PKG_CHECK_MODULES(MOZILLA, mozilla-plugin, build_mozilla_plugin=yes, - [AC_MSG_WARN([mozilla-config not found. Mozilla/Netscape plugin will not be built])] + [AC_MSG_WARN([mozilla-config not found. Mozilla/Netscape plugin will not be built])]) fi build_mozilla_plugin=no if test "x$MOZILLA_CFLAGS" != "x"; then @@ -9,7 +9,10 @@ rsvg \- Turn SVG files into raster images RSVG coverts SVG images into PNG and JPEG raster images. .SS OPTIONS .TP -.I "\-d \-\-dpi number" +.I "\-d \-\-dpi-x number" +Set the resolution of the image in pixels per inch. RSVG's current default is 90dpi +.TP +.I "\-p \-\-dpi-y number" Set the resolution of the image in pixels per inch. RSVG's current default is 90dpi .TP .I "\-x \-\-x\-zoom number" diff --git a/test-rsvg.c b/test-rsvg.c index 3c76394f..0266cfd3 100644 --- a/test-rsvg.c +++ b/test-rsvg.c @@ -44,7 +44,7 @@ main (int argc, const char **argv) int bVersion = 0; int quality = 100; char * quality_str = NULL; - char * format = "png"; + char * format = NULL; struct poptOption options_table[] = { { "dpi-x", 'd', POPT_ARG_DOUBLE, &dpi_x, 0, "pixels per inch", "<float>"}, @@ -87,10 +87,10 @@ main (int argc, const char **argv) return 1; } - if (strstr (format, "jpeg") != NULL || strstr (format, "jpg") != NULL) - format = "jpeg"; - else + if(format == NULL) format = "png"; + else if (strstr (format, "jpg") != NULL) /* backward compatibility */ + format = "jpeg"; g_type_init (); @@ -108,12 +108,17 @@ main (int argc, const char **argv) width, height, NULL); if (pixbuf) - if (strcmp (format, "jpeg") != 0 || (quality < 1 || quality > 100)) /* is a png or is an invalid quality */ - gdk_pixbuf_save (pixbuf, args[1], format, NULL, NULL); + if (strcmp (format, "jpeg") == 0) { + if (quality < 1 || quality > 100) /* is an invalid quality */ + gdk_pixbuf_save (pixbuf, args[1], format, NULL, NULL); + else { + quality_str = g_strdup_printf ("%d", quality); + gdk_pixbuf_save (pixbuf, args[1], format, NULL, "quality", quality_str, NULL); + g_free (quality_str); + } + } else { - quality_str = g_strdup_printf ("%d", quality); - gdk_pixbuf_save (pixbuf, args[1], format, NULL, "quality", quality_str, NULL); - g_free (quality_str); + gdk_pixbuf_save (pixbuf, args[1], format, NULL, NULL); } else { poptFreeContext (popt_context); |