nsxivd369f10
Fix layering of small gif frames
+7 −7
2 files changed
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20110926 | |
| 1 | + | VERSION = git-20110928 | |
| 2 | 2 | ||
| 3 | 3 | CC = gcc | |
| 4 | 4 | CFLAGS = -Wall -pedantic -O2 | |
| @@ -173,6 +173,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) { | |||
| 173 | 173 | delay = 10 * ((unsigned int) ext[3] << 8 | (unsigned int) ext[2]); | |
| 174 | 174 | if (delay) | |
| 175 | 175 | 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 */ | |
| 176 | 179 | } | |
| 177 | 180 | ext = NULL; | |
| 178 | 181 | DGifGetExtensionNext(gif, &ext); | |
| @@ -209,12 +212,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) { | |||
| 209 | 212 | ||
| 210 | 213 | for (i = 0; i < sh; i++) { | |
| 211 | 214 | 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 | + | { | |
| 218 | 218 | if (prev_frame) | |
| 219 | 219 | *ptr = prev_frame[i * sw + j]; | |
| 220 | 220 | else | |