! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Simply load the image in a thread instead async file reading and progressive ...
Status:
RESOLVED: MOVED
Product:
Ristretto
Component:
Application

Comments

Description Magnus Bergman 2019-08-23 05:09:02 CEST
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.
Comment 1 Magnus Bergman 2019-08-24 01:58:33 CEST
Created attachment 8950 
New version of the patch

New improved version of the patch with proper error handing and a little more work moved to the thread.
Comment 2 Igor editbugs 2019-08-26 18:52:56 CEST
Hi Magnus, thanks for the patch!

However, what is the intention of this change?
If it's supposed to resolve bug 11577 (which doesn't seem to have been achieved), then the patch should have been attached to that bug.
Supporting alternative backends isn't really a priority as of now.
Comment 3 Magnus Bergman 2019-08-26 23:52:26 CEST
The main intention was to suggest an easy path towards supporting alternative backends (as described in bug 15288), by first simplifying the code. If, on the other hand, it is decided that the code shouldn't be simplified (this bug resolved as WONTFIX), the alternative would be to fix the single threaded progressive loading to actually load the image progressively (since it has to be the whole point of doing it the more complicated way). After this is resolved I can go back to preparing a new patch for bug 15288 with optional use of abydos.

(I also hoped, as secondary intention, it might solve bug 11577 since it loads the image in another thread, but now I suspect that bug isn't caused by the image loading in itself).
Comment 4 Git Bot editbugs 2020-05-25 00:33:01 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org'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.xfce.org/apps/ristretto/-/issues/29.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #15874

Reported by:
Magnus Bergman
Reported on: 2019-08-23
Last modified on: 2020-05-25

People

CC List:
0 users

Version

Version:
master

Attachments

The patch (12.88 KB, patch)
2019-08-23 05:09 CEST , Magnus Bergman
no flags
New version of the patch (13.65 KB, patch)
2019-08-24 01:58 CEST , Magnus Bergman
no flags

Additional information