X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fpng2swf.c;h=b03a11dee6f2dfc351b0a3f08682544438523ad2;hb=c5632476384129c77fab3dea934358ac6e7e4418;hp=e01e0b930ef87c9920ca3b7401e950069d850f45;hpb=6bc6f6368354fb8d16e9a8fb005135a7ac5d16e8;p=swftools.git diff --git a/src/png2swf.c b/src/png2swf.c index e01e0b9..b03a11d 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -85,10 +85,10 @@ int MovieFinish(SWF * swf, TAG * t, char *sname) if FAILED(swf_WriteCGI(swf)) fprintf(stderr,"WriteCGI() failed.\n"); } else { if(global.version >= 6) { - if (swf_WriteSWC(handle, swf)<0) + if (swf_WriteSWC(f, swf)<0) fprintf(stderr, "Unable to write output file: %s\n", sname); } else { - if (swf_WriteSWF(handle, swf)<0) + if (swf_WriteSWF(f, swf)<0) fprintf(stderr, "Unable to write output file: %s\n", sname); } if (f != so) @@ -315,11 +315,11 @@ void applyfilter4(int mode, U8*src, U8*old, U8*dest, int width) unsigned char lastr=0; unsigned char lastg=0; unsigned char lastb=0; - unsigned char lasta=0; + unsigned char lasta=0; //TODO: 255? unsigned char upperlastr=0; unsigned char upperlastg=0; unsigned char upperlastb=0; - unsigned char upperlasta=0; + unsigned char upperlasta=0; //TODO: 255? if(mode==0) { for(x=0;x>header.bpp); + palettelen = 1<= 256.0)) { + /* removed framerate>0 restriction in order to make + Flash Communication Server compatible SWFs */ + if ((global.framerate < 0) ||(global.framerate >= 256.0)) { if (VERBOSE(1)) fprintf(stderr, "Error: You must specify a valid framerate between 1/256 and 255.\n"); @@ -791,8 +797,8 @@ int args_callback_option(char *arg, char *val) break; case 'z': - global.version = 1; - res = 1; + global.version = 6; + res = 0; break; case 'C': @@ -800,9 +806,15 @@ int args_callback_option(char *arg, char *val) break; case 'v': - if (val) - global.verbose = atoi(val); - res = 1; + global.verbose++; + res = 0; + break; + + case 'q': + global.verbose--; + if(global.verbose<0) + global.verbose = 0; + res = 0; break; case 'X': @@ -842,6 +854,7 @@ static struct options_t options[] = { {"X", "pixel"}, {"Y", "pixel"}, {"v", "verbose"}, +{"q", "quiet"}, {"C", "cgi"}, {"V", "version"}, {0,0} @@ -881,7 +894,8 @@ void args_callback_usage(char *name) printf("-z , --zlib Enable Flash 6 (MX) Zlib Compression\n"); printf("-X , --pixel Force movie width to (default: autodetect)\n"); printf("-Y , --pixel Force movie height to (default: autodetect)\n"); - printf("-v , --verbose Set verbose level (0=quiet, 1=default, 2=debug)\n"); + printf("-v , --verbose Be verbose. Use more than one -v for greater effect \n"); + printf("-q , --quiet Omit normal log messages, only log errors\n"); printf("-C , --cgi For use as CGI- prepend http header, write to stdout\n"); printf("-V , --version Print version information and exit\n"); printf("\n"); @@ -899,9 +913,11 @@ int main(int argc, char **argv) global.version = 4; processargs(argc, argv); - - if(global.nfiles<=0) + + if(global.nfiles<=0) { + fprintf(stderr, "No png files found in arguments\n"); return 1; + } if (VERBOSE(2)) fprintf(stderr, "Processing %i file(s)...\n", global.nfiles);