Commit f59d1d17 authored by Debarshi Ray's avatar Debarshi Ray

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].

Fixes: dd1f222f

[1] gnome-desktop@f9b2c480

#99
parent d1d8b5f9
Pipeline #45970 passed with stage
in 4 minutes
......@@ -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");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment