X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswfbits.c;h=84a3b5065d5314687c5131db55b96d54f4f8f8ef;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=1e32cf2ec7e17c5929b80a2dde9e43bdb976d654;hpb=006f7afc9efc533175af7eba679998af948adfa3;p=swftools.git diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index 1e32cf2..84a3b50 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -887,6 +887,7 @@ void swf_SetLosslessImage(TAG*tag, RGBA*data, int width, int height) tag->id = ST_DEFINEBITSLOSSLESS; } else { tag->id = ST_DEFINEBITSLOSSLESS2; + /* FIXME: we're destroying the callers data here */ swf_PreMultiplyAlpha(data, width, height); } num = swf_ImageGetNumberOfPaletteEntries(data, width, height, 0); @@ -1151,6 +1152,7 @@ int swf_SetJPEGBits3(TAG * tag, U16 width, U16 height, RGBA * bitmap, int qualit #endif +#define NO_LOSSLESS /* expects mem to be non-premultiplied */ TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quality) { @@ -1169,7 +1171,8 @@ TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quali #endif #if defined(HAVE_JPEGLIB) - /* try jpeg image */ + /* try jpeg image. Notice that if (and only if) we tried the lossless compression + above, the data will now be premultiplied with alpha. */ if(has_alpha) { tag2 = swf_InsertTag(0, ST_DEFINEBITSJPEG3); swf_SetU16(tag2, bitid);