From 451e12690e443bd74a5ce9a597f344e14ef40089 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sun, 22 Aug 2021 14:31:03 +0100 Subject: [PATCH] Fix #813: Animated GIF should use faster antialiasing (or none at all) https://github.com/BestImageViewer/geeqie/issues/813 If the file extension is .gif, 2pass is set to FALSE, and interpolation is set to nearest. --- src/image.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/image.c b/src/image.c index c81b1c50..889f241e 100644 --- a/src/image.c +++ b/src/image.c @@ -1095,6 +1095,15 @@ static void image_change_complete(ImageWindow *imd, gdouble zoom) pr = PIXBUF_RENDERER(imd->pr); pr->zoom = zoom; /* store the zoom, needed by the loader */ + /* Disable 2-pass for GIFs. Animated GIFs can flicker when enabled + * Reduce quality to worst but fastest to avoid dropped frames */ + if (g_ascii_strcasecmp(imd->image_fd->extension, ".GIF") == 0) + { + g_object_set(G_OBJECT(imd->pr), "zoom_2pass", FALSE, NULL); + g_object_set(G_OBJECT(imd->pr), "zoom_quality", GDK_INTERP_NEAREST, NULL); + } + + if (image_load_begin(imd, imd->image_fd)) { imd->unknown = FALSE; -- 2.20.1