get_as_pixbuf_for_size() loads webp files twice
get_as_pixbuf_for_size()
(which gets called from gnome_bg_draw()
) uses gdk_pixbuf_get_file_info()
to determine if the image is a SVG and then later loads the image using gdk_pixbuf_new_from_file*()
. Both of these cause the webp pixbuf loader to fully load the file, which has gotten significantly slower in its recent releases. Using gio or something like that to check for SVGs would probably give us a 2x speedup when using webp backgrounds.
Alternatively the webp pixbuf loader could try to detect when it is called from gdk_pixbuf_get_file_info()
(like the TIFF loader seems to do) and stop early, but I'm not sure if that's possible.
cc: @aruiz