From a694b731da2eed7c0302a78386f03f8c7ca9869f Mon Sep 17 00:00:00 2001 From: kramm Date: Sun, 27 Mar 2005 21:00:18 +0000 Subject: [PATCH 1/1] fixed a bug in swf_ExtractImage() for 8-bit palette lossless images --- lib/modules/swfbits.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/modules/swfbits.c b/lib/modules/swfbits.c index f238503..bc1e0f8 100644 --- a/lib/modules/swfbits.c +++ b/lib/modules/swfbits.c @@ -801,6 +801,8 @@ RGBA *swf_DefineLosslessBitsTagToImage(TAG * tag, int *dwidth, int *dheight) palette[t].b = data[pos++]; if (alpha) { palette[t].a = data[pos++]; + } else { + palette[t].a = 255; } } } @@ -820,7 +822,11 @@ RGBA *swf_DefineLosslessBitsTagToImage(TAG * tag, int *dwidth, int *dheight) } } else { for (x = 0; x < width; x++) { - /* TODO: un-premultiply alpha? */ + /* TODO: premultiply alpha? + dest[pos2].r = (data[pos + 1]*255)/data[pos+0]; + dest[pos2].g = (data[pos + 2]*255)/data[pos+0]; + dest[pos2].b = (data[pos + 3]*255)/data[pos+0]; + */ dest[pos2].r = data[pos + 1]; dest[pos2].g = data[pos + 2]; dest[pos2].b = data[pos + 3]; -- 1.7.10.4