GIF images no longer loading after upgrading Fedora to F43 which brings in GTK4 4.20.2

I have an application where I am using resources.gresource.xmlto load a number of .gif images that are used on buttons via composite template .ui files. e.g.
<object class="GtkButton" id="btn_make_plan">
<property name="tooltip_text" translatable="yes">Generate plan</property>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="resource">/com/shartrec/kelpie_planner/images/generate_plan.png</property>
<property name="icon_size">1</property>
</object>
</child>
</object>

This worked fine until I upgraded my Fedora system to F43 and now the images do not load. gtk4 package is now at 4.20.2

As a test I converted one image to a .png and updated my code and that image loaded without issue.

Is support for gif format removed, I couldn’t find any reference to that, or is this a gtk4 bug?

I had a similar problem with F43 but for xpm images. I don’t know if this will help but try installing

gdk-pixbuf2-modules-extra

Michael

Edit … gif is considered fringe :weary_cat:

GIF is fringe in the context of gdk-pixbuf, but you need to understand that gdk-pixbuf is only meant to be used to load trusted assets like icons. On top of that, the animation API for GdkPixbuf has been deprecated because it’s not Y2038-safe, and it cannot be fixed without bumping gdk-pixbuf’s API version, something that will not happen. Using GIF for icons is not something that is common across the platform, either.

If you are loading images from untrusted sources, please switch to a safe image loading library, like Glycin.

As for XPM: it’s 2025. There are zero reasons why you should use that format. If you need to embed assets in your binary, use the GResource API.