aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2015-11-11 14:03:44 +0000
committerHarry Jeffery <harry@exec64.co.uk>2015-11-11 14:04:24 +0000
commitd1f0e07abd9bbb72ca825fe8e2fe9fa12cc6746f (patch)
treeac8142467b2a69dde92429762585fa4d0eac3c86
parent4b1e0997125fcda319facfe630938ba9269ae70c (diff)
downloadimv-d1f0e07abd9bbb72ca825fe8e2fe9fa12cc6746f.tar.gz
Fix unusual gifs
-rw-r--r--image.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/image.c b/image.c
index 9390645..8516bf5 100644
--- a/image.c
+++ b/image.c
@@ -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) {