X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=src%2Fpng2swf.c;h=91f2188ec4996b7317ae789a8804cf8d17bd4a52;hp=5da1945d083ea7b367d8cb033023f375827f0ad5;hb=2391d7ae5d8a145a250a8b80ab8c93ba74eba030;hpb=5b0f171d461fac3d379022d195cafe1992243466 diff --git a/src/png2swf.c b/src/png2swf.c index 5da1945..91f2188 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -100,13 +100,8 @@ int MovieFinish(SWF * swf, TAG * t, char *sname) if(global.do_cgi) { if FAILED(swf_WriteCGI(swf)) fprintf(stderr,"WriteCGI() failed.\n"); } else { - if(global.version >= 6) { - if (swf_WriteSWC(f, swf)<0) - fprintf(stderr, "Unable to write output file: %s\n", sname); - } else { - if (swf_WriteSWF(f, swf)<0) - fprintf(stderr, "Unable to write output file: %s\n", sname); - } + if (swf_WriteSWF(f, swf)<0) + fprintf(stderr, "Unable to write output file: %s\n", sname); if (f != so) close(f); } @@ -168,7 +163,7 @@ int png_read_header(FILE*fi, struct png_header*header) U8 head2[8]; U8*data; fread(head2,8,1,fi); - if(strncmp(head,head2,4)) + if(strncmp((char*)head,(char*)head2,4)) return 0; while(png_read_chunk(&id, &len, &data, fi)) @@ -202,7 +197,7 @@ int png_read_header(FILE*fi, struct png_header*header) exit(1); } if(a!=8 && (b==2 || b==6)) { - fprintf(stderr, "Bpp %d in mode %d not supported!\n", a); + fprintf(stderr, "Bpp %d in mode %d not supported!\n", b, a); exit(1); } if(c!=0) { @@ -558,7 +553,7 @@ TAG* PNG2Image(TAG*t, U16 id, char*filename, int*width, int*height) } if(!zimagedata || uncompress(imagedata, &imagedatalen, zimagedata, zimagedatalen) != Z_OK) { - fprintf(stderr, "Couldn't uncompress IDAT chunk (%d bytes) in %s!\n", imagedatalen, filename); + fprintf(stderr, "Couldn't uncompress IDAT chunk (%lu bytes) in %s!\n", imagedatalen, filename); if(zimagedata) free(zimagedata); return 0; @@ -756,7 +751,14 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) int width=0, height=0; +#ifndef HAVE_JPEGLIB + if(global.mkjpeg) { + global.mkjpeg = 0; + msg(" No jpeg support compiled in"); + } +#endif if(global.mkjpeg) { +#ifdef HAVE_JPEGLIB RGBA*data = 0; getPNG(sname, &width, &height, (unsigned char**)&data); if(!data) @@ -770,6 +772,7 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) swf_SetU16(t, id); swf_SetJPEGBits2(t, width,height,data,global.mkjpeg); } +#endif } else if(1) { RGBA*data = 0; getPNG(sname, &width, &height, (unsigned char**)&data); @@ -789,8 +792,8 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) swf_GetMatrix(NULL, &m); m.sx = (int)(20 * 0x10000); m.sy = (int)(20 * 0x10000); - m.tx = -10; - m.ty = -10; + m.tx = 0; + m.ty = 0; fs = swf_ShapeAddBitmapFillStyle(s, &m, id, 1); swf_SetU16(t, id + 1); // id @@ -1064,7 +1067,7 @@ void args_callback_usage(char *name) 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("-s , --scale Scale image to % size.\n"); + printf("-s , --scale Scale image to %% size.\n"); printf("\n"); } @@ -1077,7 +1080,7 @@ int main(int argc, char **argv) global.framerate = 1.0; global.verbose = 1; - global.version = 6; + global.version = 8; global.scale = 1.0; processargs(argc, argv);