X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fpng2swf.c;h=6e04212a4cd0e3aa35fbe5e7bb65d8266c6ce055;hb=202babdc64693506daa042c25b76eab46835c94e;hp=989e3ba2b7557365f2c526c8e320dbeb7615e46b;hpb=08436744d1326f8314bcbc18df64f7b1977b1685;p=swftools.git diff --git a/src/png2swf.c b/src/png2swf.c index 989e3ba..6e04212 100644 --- a/src/png2swf.c +++ b/src/png2swf.c @@ -61,7 +61,7 @@ TAG *MovieStart(SWF * swf, float framerate, int dx, int dy) t = swf->firstTag = swf_InsertTag(NULL, ST_SETBACKGROUNDCOLOR); rgb.r = rgb.g = rgb.b = rgb.a = 0x00; - //rgb.g = 0xff; <--- handy for testing alpha conversion + //rgb.g = 0xff; //<--- handy for testing alpha conversion swf_SetRGB(t, &rgb); return t; @@ -575,40 +575,30 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) free(firstline); /* the image is now compressed and stored in data. Now let's take - a look at the alpha values to determine which bitmap type we - should write */ - if(header.mode == 6) - for(y=0;yid = ST_DEFINEBITSLOSSLESS2; } } - /* mode 6 images which are not fully opaque or fully transparent - will be stored as definejpeg3 */ - if(header.mode == 6 && transparent != header.width*header.height - && opaque != header.width*header.height) -#ifndef HAVE_JPEGLIB - fprintf(stderr, "Warning: No jpeg lib compiled in- not able to store transparency information\n"); -#else - { - fprintf(stderr, "Image has transparency information. Storing as DefineBitsJpeg3 Tag (jpeg+alpha)\n"); - if(VERBOSE(2)) - printf("Image is semi-transparent\n"); - - // we always use quality 100, since png2swf is expected to - // use more or less lossless compression - - swf_SetJPEGBits3(t, header.width, header.height, (RGBA*)data2, 100); - t->id = ST_DEFINEBITSJPEG3; - } - else -#endif - { - swf_SetLosslessBits(t, header.width, header.height, data2, BMF_32BIT); - } + swf_SetLosslessBits(t, header.width, header.height, data2, BMF_32BIT); free(data2); } else if(header.mode == 0 || header.mode == 3) { RGBA*rgba; @@ -630,13 +620,9 @@ TAG *MovieAddFrame(SWF * swf, TAG * t, char *sname, int id) rgba[i].b = palette[i*3+2]; if(alphapalette && i