Simply load the image in a thread instead async file reading and progressive loading
Submitted by Magnus Bergman
Assigned to Igor
Created attachment 8943 The patch
The current code uses the asynchronous API of GFile to read files and the progressive API of GDK-Pixbuf for decoding the image. This allows images to be gradually displayed while asynchronously loaded while (at least theoretically) avoid using threads. This is neat and all, but IMHO overly complex and possibly even error prone. This patch, instead, simply loads the image in a separate thread. This will hopefully solve bug 11577 as well as making it easier to support alternative image loader backends (bug 15288). On the downside it also removes support for gradually displaying images as they load. But this isn't working now anyway (the function to update the view is first invoked then the image is completely decoded). And even if it worked, the use case would be quite limited since images load pretty much instantaneously nowadays. And a partially loaded image showing up for a brief moment would probably only be perceived as ugly, and a bad user experience.
Patch 8943, "The patch":