Krolyxon
Commit d369f10

Branches

Refs →

nsxivd369f10

Fix layering of small gif frames

Author
Bert Münnich
Date
2011-09-28 12:53 +0200
Parent
0a91ede
Commit
d369f10aa56deafbc1816037d5a30af2f9bdbc50

+7 −7

2 files changed

  1. M Makefile +1 −1
  2. M image.c +6 −6
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20110926
1+VERSION = git-20110928
22
33 CC = gcc
44 CFLAGS = -Wall -pedantic -O2
M image.c View
@@ -173,6 +173,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) {
173173 delay = 10 * ((unsigned int) ext[3] << 8 | (unsigned int) ext[2]);
174174 if (delay)
175175 delay = MAX(delay, MIN_GIF_DELAY);
176+
177+ /* TODO: handle disposal method, section 23.c.iv of
178+ http://www.w3.org/Graphics/GIF/spec-gif89a.txt */
176179 }
177180 ext = NULL;
178181 DGifGetExtensionNext(gif, &ext);
@@ -209,12 +212,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) {
209212
210213 for (i = 0; i < sh; i++) {
211214 for (j = 0; j < sw; j++) {
212− if (i < y || i >= y + h || j < x || j >= x + w) {
213− if (transp >= 0 && prev_frame)
214− *ptr = prev_frame[i * sw + j];
215− else
216− *ptr = bgpixel;
217− } else if (rows[i-y][j-x] == transp) {
215+ if (i < y || i >= y + h || j < x || j >= x + w ||
216+ rows[i-y][j-x] == transp)
217+ {
218218 if (prev_frame)
219219 *ptr = prev_frame[i * sw + j];
220220 else