summaryrefslogtreecommitdiffstats
path: root/image.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@gmx.com>2011-09-28 12:53:44 +0200
committerBert Münnich <ber.t@gmx.com>2011-09-28 12:53:44 +0200
commitd369f10aa56deafbc1816037d5a30af2f9bdbc50 (patch)
tree9f506a1bd026a9d9f8a40cc423c6ceeb88d5e87d /image.c
parent0a91ede86c370aacb2b3a91e411f1f05349c12f6 (diff)
downloadnsxiv-d369f10aa56deafbc1816037d5a30af2f9bdbc50.tar.zst
Fix layering of small gif frames
Diffstat (limited to 'image.c')
-rw-r--r--image.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/image.c b/image.c
index 9896a54..77a89b0 100644
--- a/image.c
+++ b/image.c
@@ -173,6 +173,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) {
delay = 10 * ((unsigned int) ext[3] << 8 | (unsigned int) ext[2]);
if (delay)
delay = MAX(delay, MIN_GIF_DELAY);
+
+ /* TODO: handle disposal method, section 23.c.iv of
+ http://www.w3.org/Graphics/GIF/spec-gif89a.txt */
}
ext = NULL;
DGifGetExtensionNext(gif, &ext);
@@ -209,12 +212,9 @@ bool img_load_gif(img_t *img, const fileinfo_t *file) {
for (i = 0; i < sh; i++) {
for (j = 0; j < sw; j++) {
- if (i < y || i >= y + h || j < x || j >= x + w) {
- if (transp >= 0 && prev_frame)
- *ptr = prev_frame[i * sw + j];
- else
- *ptr = bgpixel;
- } else if (rows[i-y][j-x] == transp) {
+ if (i < y || i >= y + h || j < x || j >= x + w ||
+ rows[i-y][j-x] == transp)
+ {
if (prev_frame)
*ptr = prev_frame[i * sw + j];
else