X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fswfextract.c;h=ee15f6235d044dec271a14a6affe24d82c4a00c7;hb=4d50e9ccf474061088318da8e7a67789fd488a2a;hp=69f663ac57bc7bcbc6f18f17fda0bfcd508ce88a;hpb=5e03af6db9585cf5b4eb1081127572883b7a01cb;p=swftools.git diff --git a/src/swfextract.c b/src/swfextract.c index 69f663a..ee15f62 100644 --- a/src/swfextract.c +++ b/src/swfextract.c @@ -356,6 +356,7 @@ void extractTag(SWF*swf, char*filename) if(!originalplaceobjects && (extractids||extractname_id>=0)) { int number = 0; int id = 0; + int t; TAG* objtag = 0; SRECT bbox; memset(&bbox, 0, sizeof(SRECT)); @@ -381,7 +382,6 @@ void extractTag(SWF*swf, char*filename) } } - int t; if((objectbbox.xmin|objectbbox.ymin|objectbbox.xmax|objectbbox.ymax)!=0) newswf.movieSize = objectbbox; if(extractname_id>=0) { @@ -457,6 +457,8 @@ void listObjects(SWF*swf) int t; int frame = 0; char*names[] = {"Shape", "MovieClip", "JPEG", "PNG", "Sound", "Font"}; + char*options[] = {"-i", "-i", "-j", "-p", "-s", "-F"}; + int mp3=0; printf("Objects in file %s:\n",filename); swf_FoldAll(swf); for(t=0;tfirstTag; first = 1; while(tag) { + if(tag->id == ST_SOUNDSTREAMHEAD || tag->id == ST_SOUNDSTREAMHEAD2) + mp3 = 1; if(isOfType(t,tag)) nr++; tag = tag->next; @@ -473,7 +477,7 @@ void listObjects(SWF*swf) if(!nr) continue; - printf(" %d %s%s: ID(s) ", nr, names[t], nr>1?"s":""); + printf(" [%s] %d %s%s: ID(s) ", options[t], nr, names[t], nr>1?"s":""); tag = swf->firstTag; while(tag) { @@ -516,9 +520,12 @@ void listObjects(SWF*swf) } if(frame) - printf(" %d Frames: ID(s) 0-%d\n", frame, frame); + printf(" [-f] %d Frames: ID(s) 0-%d\n", frame, frame); else - printf(" 1 Frame: ID(s) 0\n"); + printf(" [-f] 1 Frame: ID(s) 0\n"); + + if(mp3) + printf(" [-m] 1 MP3 Soundstream\n"); } void handlefont(SWF*swf, TAG*tag) @@ -823,12 +830,21 @@ void handlelossless(TAG*tag) png_write_byte(fi,palette[t].b); } png_end_chunk(fi); + + if(alpha) { + /* write alpha palette */ + png_start_chunk(fi, "tRNS", 256); + for(t=0;t<256;t++) { + png_write_byte(fi,palette[t].a); + } + png_end_chunk(fi); + } } { int pos2 = 0; int x,y; int srcwidth = width * (bpp/8); - datalen3 = width*height*4; + datalen3 = (width*4+5)*height; data3 = (U8*)malloc(datalen3); for(y=0;y