summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2018-12-14 12:55:16 +0000
committerBastien Nocera <hadess@hadess.net>2018-12-14 12:55:16 +0000
commita7d8e14c9a1f220657a40d62b6019aa4856fa290 (patch)
tree68f6815b32b0f1da60d0b696cb65ee8e91632012
parentd1d8b5f9065f5d4a1d7ca0a0e298db9f5c5d256a (diff)
parentf59d1d177f641562f44915401577d22569ed2a8c (diff)
downloadgdk-pixbuf-a7d8e14c9a1f220657a40d62b6019aa4856fa290.tar.gz
Merge branch 'wip/rishi/unbreak-thumbnailing-gifs' into 'master'
thumbnailer: Unbreak thumbnailing of GIFs See merge request GNOME/gdk-pixbuf!32
-rw-r--r--thumbnailer/gdk-pixbuf-thumbnailer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/thumbnailer/gdk-pixbuf-thumbnailer.c b/thumbnailer/gdk-pixbuf-thumbnailer.c
index d50ede8ee..8308ecaf7 100644
--- a/thumbnailer/gdk-pixbuf-thumbnailer.c
+++ b/thumbnailer/gdk-pixbuf-thumbnailer.c
@@ -36,6 +36,14 @@ file_to_pixbuf (const char *path,
if (pixbuf == NULL)
return NULL;
+ /* The GIF codec throws GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION
+ * if it's closed without decoding all the frames. Since
+ * gdk_pixbuf_new_from_file_at_size only decodes the first
+ * frame, this specific error needs to be ignored.
+ */
+ if (error != NULL && g_error_matches (*error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION))
+ g_clear_error (error);
+
tmp_pixbuf = gdk_pixbuf_apply_embedded_orientation (pixbuf);
gdk_pixbuf_copy_options (pixbuf, tmp_pixbuf);
gdk_pixbuf_remove_option (tmp_pixbuf, "orientation");