From: kramm Date: Sun, 27 Mar 2005 21:00:18 +0000 (+0000) Subject: fixed a bug in swf_ExtractImage() for 8-bit palette lossless images X-Git-Tag: release-0-7-0~156 X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=a694b731da2eed7c0302a78386f03f8c7ca9869f;hp=f240760415f2f9312368cedd845ac3c5eac4c565;p=swftools.git fixed a bug in swf_ExtractImage() for 8-bit palette lossless images --- 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];