Commit a6d164bd authored by Dom Lachowicz's avatar Dom Lachowicz

Update documentation Fix build Refactor a bit - allow for saving to ICO or

	* 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
parent 28110798
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;
......
......@@ -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"
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment