From: kramm Date: Tue, 22 Feb 2005 20:08:43 +0000 (+0000) Subject: fixed handling of alpha palettes in PNG extraction. X-Git-Tag: release-0-7-0~204 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=f0736677d3b695eb668c2e3888dec7705d3e8d89 fixed handling of alpha palettes in PNG extraction. --- diff --git a/src/swfextract.c b/src/swfextract.c index a4a2ded..ee15f62 100644 --- a/src/swfextract.c +++ b/src/swfextract.c @@ -830,12 +830,21 @@ void handlelossless(TAG*tag) png_write_byte(fi,palette[t].b); } png_end_chunk(fi); + + if(alpha) { + /* write alpha palette */ + png_start_chunk(fi, "tRNS", 256); + for(t=0;t<256;t++) { + png_write_byte(fi,palette[t].a); + } + png_end_chunk(fi); + } } { int pos2 = 0; int x,y; int srcwidth = width * (bpp/8); - datalen3 = width*height*4; + datalen3 = (width*4+5)*height; data3 = (U8*)malloc(datalen3); for(y=0;y