diff options
author | Sean Fox <dyntryx@gmail.com> | 2009-01-07 09:49:36 +0000 |
---|---|---|
committer | Sean Fox <dyntryx@gmail.com> | 2009-01-07 09:49:36 +0000 |
commit | 9a2811c3832ac1cc3fdc274f627e75ffa1d43efc (patch) | |
tree | 74c6ce9e440f39dd09c01ed738544228d5ecab3f | |
parent | 2247ced70842f51bdd90577b6a9e20b465674e46 (diff) | |
download | libnsgif-9a2811c3832ac1cc3fdc274f627e75ffa1d43efc.tar.gz libnsgif-9a2811c3832ac1cc3fdc274f627e75ffa1d43efc.tar.bz2 |
If a frame's disposal method is GIF_FRAME_CLEAR and the frame has a transparency index, the frame will be restored to transparency instead of the background colour
svn path=/trunk/libnsgif/; revision=5975
-rw-r--r-- | libnsgif.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -992,7 +992,10 @@ gif_result gif_decode_frame(gif_animation *gif, unsigned int frame) { if (gif->frames[frame].disposal_method == GIF_FRAME_CLEAR) { for (y = 0; y < height; y++) { frame_scanline = frame_data + offset_x + ((offset_y + y) * gif->width); - memset(frame_scanline, colour_table[gif->background_index], width * 4); + if (gif->frames[frame].transparency) + memset(frame_scanline, GIF_TRANSPARENT_COLOUR, width * 4); + else + memset(frame_scanline, colour_table[gif->background_index], width * 4); } } } |