X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fpng2swf.c;h=52a442fbe79b13e5e8e44fb39f5a7aa26864dc4b;hb=495eb07179f8739f49496cfe79223cd85baf2bdd;hp=a720c3a2fcc2a9d9606b95123dc82a76530a4af5;hpb=563669a80ba6ae83759988841fc4ec23df4e78b6;p=swftools.git diff --git a/src/png2swf.c b/src/png2swf.c index a720c3a..52a442f 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -26,7 +26,6 @@ struct { int max_image_height; int force_width; int force_height; - int prescale; int nfiles; int verbose; char *outfile; @@ -34,7 +33,6 @@ struct { struct { char *filename; - int scale; } image[MAX_INPUT_FILES]; TAG *MovieStart(SWF * swf, int framerate, int dx, int dy) @@ -161,8 +159,7 @@ int png_read_header(FILE*fi, struct png_header*header) return 0; } -TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int scale, - int id) +TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) { SHAPE *s; SRECT r; @@ -174,8 +171,8 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int scale, U8*data; U8*imagedata; unsigned long int imagedatalen; - U8*palette; - int palettelen; + U8*palette = 0; + int palettelen = 0; struct png_header header; int bypp; @@ -252,6 +249,10 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int scale, U8*data2 = malloc((header.width+4)*header.height); int i,x,y; int pos=0; + if(!palette) { + fprintf(stderr, "Error: No palette found!\n"); + exit(1); + } /* 24->32 bit conversion */ for(i=0;i= MAX_INPUT_FILES) { if (VERBOSE(1)) @@ -466,11 +464,10 @@ void args_callback_usage(char *name) printf("Usage: %s [-options [value]] imagefiles[.png] [...]\n", name); printf("-r framerate (rate) Set movie framerate (100/sec)\n"); printf("-o outputfile (output) Set name for SWF output file\n"); - printf("-X pixel (width) Force movie width to scale (default: autodetect)\n"); - printf("-Y pixel (height) Force movie height to scale (default: autodetect)\n"); + printf("-X pixel (width) Force movie width to pixel (default: autodetect)\n"); + printf("-Y pixel (height) Force movie height to pixel (default: autodetect)\n"); printf("-v level (verbose) Set verbose level (0=quiet, 1=default, 2=debug)\n"); printf("-V (version) Print version information and exit\n"); - printf("The following options can be set independently for each image: -q -s\n"); } @@ -483,7 +480,6 @@ int main(int argc, char **argv) global.framerate = 100; global.verbose = 1; - global.prescale = 1; processargs(argc, argv); @@ -500,11 +496,9 @@ int main(int argc, char **argv) int i; for (i = 0; i < global.nfiles; i++) { if (VERBOSE(3)) - fprintf(stderr, "[%03i] %s (1/%i)\n", i, - image[i].filename, - image[i].scale); - t = MovieAddFrame(&swf, t, image[i].filename, - image[i].scale, (i * 2) + 1); + fprintf(stderr, "[%03i] %s\n", i, + image[i].filename); + t = MovieAddFrame(&swf, t, image[i].filename, (i * 2) + 1); free(image[i].filename); } }