[gdk-pixbuf/wip/rishi/unbreak-thumbnailing-gifs] thumbnailer: Unbreak thumbnailing of GIFs



commit 6418d6da6a56519aa1585526067d891b5b2a87e0
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Dec 12 18:57:27 2018 +0100

    thumbnailer: Unbreak thumbnailing of GIFs
    
    The GIF codec throws GDK_PIXBUF_ERROR_INCOMPLETE_ANIMATION if it's
    closed without decoding all the frames. The thumbnailer has always,
    both now with gdk_pixbuf_new_from_file_at_scale and earlier, decoded
    only the first animation frame, which is why this specific error needs
    to be ignored [1].
    
    Fallout from dd1f222f78eed2b7d70a5e8507199c78e3f9e12b
    
    [1] https://gitlab.gnome.org/GNOME/gnome-desktop/commit/f9b2c480e38d
    
    https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/99

 thumbnailer/gdk-pixbuf-thumbnailer.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/thumbnailer/gdk-pixbuf-thumbnailer.c b/thumbnailer/gdk-pixbuf-thumbnailer.c
index d50ede8ee..8e4a51948 100644
--- a/thumbnailer/gdk-pixbuf-thumbnailer.c
+++ b/thumbnailer/gdk-pixbuf-thumbnailer.c
@@ -36,6 +36,9 @@ file_to_pixbuf (const char  *path,
        if (pixbuf == NULL)
                return NULL;
 
+       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");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]