diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2015-11-11 14:03:44 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2015-11-11 14:04:24 +0000 |
commit | d1f0e07abd9bbb72ca825fe8e2fe9fa12cc6746f (patch) | |
tree | ac8142467b2a69dde92429762585fa4d0eac3c86 | |
parent | 4b1e0997125fcda319facfe630938ba9269ae70c (diff) | |
download | imv-d1f0e07abd9bbb72ca825fe8e2fe9fa12cc6746f.tar.gz |
Fix unusual gifs
-rw-r--r-- | image.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -170,6 +170,21 @@ void imv_image_load_next_frame(struct imv_image *img) frame32 = expanded; } + /* If the frame is still too small, enlarge it to fit */ + if(img->width != (int)FreeImage_GetWidth(frame32) || + img->height != (int)FreeImage_GetHeight(frame32)) { + RGBQUAD color = {0,0,0,0}; + FIBITMAP *expanded = FreeImage_EnlargeCanvas(frame32, + 0, + img->height - FreeImage_GetHeight(frame32), + img->width - FreeImage_GetWidth(frame32), + 0, + &color, + 0); + FreeImage_Unload(frame32); + frame32 = expanded; + } + switch(disposal_method) { case 0: /* nothing specified, just use the raw frame */ if(img->cur_bmp) { |