+ fclose(fi);
+ return t;
+}
+
+TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id)
+{
+ SHAPE *s;
+ SRECT r;
+ MATRIX m;
+ int fs;
+
+ int width=0, height=0;
+
+ if(global.mkjpeg) {
+ RGBA*data = 0;
+ getPNG(sname, &width, &height, (unsigned char**)&data);
+ if(!data)
+ exit(1);
+ if(swf_ImageHasAlpha(data, width, height)) {
+ t = swf_InsertTag(t, ST_DEFINEBITSJPEG3);
+ swf_SetU16(t, id);
+ swf_SetJPEGBits3(t, width,height,data,global.mkjpeg);
+ } else {
+ t = swf_InsertTag(t, ST_DEFINEBITSJPEG2);
+ swf_SetU16(t, id);
+ swf_SetJPEGBits2(t, width,height,data,global.mkjpeg);
+ }
+ } else if(1) {
+ RGBA*data = 0;
+ getPNG(sname, &width, &height, (unsigned char**)&data);
+ if(!data)
+ exit(1);
+ t = swf_InsertTag(t, ST_DEFINEBITSLOSSLESS);
+ swf_SetU16(t, id);
+ swf_SetLosslessImage(t, data,width,height);
+ } else {
+ /* old code: transform PNG encoding 1:1 to SWF */
+ t = PNG2Image(t, id, sname, &width, &height);
+ }