gdk_pixbuf_new_from_stream loads all GIF frames unnecessarily
If you use
gdk_pixbuf_new_from_stream it loads all the frames of a GIF and then throws away all but the first one to make the GdkPixbuf. This causes huge memory and CPU usage and for large GIF files. In 9ff2d544 an optimisation was made to only load the first frame, but this only works for
gdk_pixbuf_new_from_file as it uses another codepath. The codepath used by
gdk_pixbuf_new_from_stream is used for both animation and pixbuf loading.
Perhaps we should make it possible to tell a Pixbuf loader if the animation is loaded so this optimization can be used.