From: kramm Date: Wed, 12 Nov 2008 10:41:31 +0000 (+0000) Subject: added rescaling X-Git-Tag: release-0-9-0~819 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=f9dce1cb6c3810ff91601016ae3cba172ca7f903 added rescaling --- diff --git a/src/swfrender.c b/src/swfrender.c index b782555..9362fde 100644 --- a/src/swfrender.c +++ b/src/swfrender.c @@ -16,6 +16,8 @@ static struct options_t options[] = { {"o", "output"}, {"l", "legacy"}, {"V", "version"}, +{"X", "width"}, +{"Y", "height"}, {0,0} }; @@ -24,6 +26,9 @@ static char*filename = 0; static char*outputname = "output.png"; static int quantize = 0; +static int width = 0; +static int height = 0; + int args_callback_option(char*name,char*val) { if(!strcmp(name, "V")) { @@ -38,6 +43,12 @@ int args_callback_option(char*name,char*val) } else if(!strcmp(name, "q")) { quantize = 1; return 0; + } else if(!strcmp(name, "X")) { + width = atoi(val); + return 1; + } else if(!strcmp(name, "Y")) { + height = atoi(val); + return 1; } else { printf("Unknown option: -%s\n", name); exit(1); @@ -116,6 +127,9 @@ int main(int argn, char*argv[]) if(quantize) { dev->setparameter(dev, "palette", "1"); } + if(width || height) { + dev = gfxdevice_rescale_new(dev, width, height, 0); + } int t; for(t=1;t<=doc->num_pages;t++) {