GNOME Bugzilla – Bug 735422
gdk_pixbuf_new_from_file_at_scale is broken for animated GIFs
Last modified: 2018-05-22 13:16:36 UTC
If an animated gif is loaded via gdk_pixbuf_new_from_file_at_scale, GdkPixbuf throws "GIF image was truncated or incomplete". This happens seemingly independent of the scale provided, and would appear to be because the GdkPixbufLoader for the gif is being closed before the gif has been fully read (i.e. its state is GIF_LZW_FILL_BUFFER at Loader closing time). Perhaps the check for an existing animation at gdk-pixbuf/gdk-pixbuf-io.c:L1361 isn't a reliable tell for when the image is ready to be closed? Here's a tiny script to reproduce. Sample image is SFW adorable cat gif: curl http://i.imgur.com/psu515W.gif -o catbee.gif gjs -c "imports.gi.GdkPixbuf.Pixbuf.new_from_file_at_scale('catbee.gif', -1, -1, true);"
Reproduced with gdk-pixbuf 2.31.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues/45.