! 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 !
Partially written files sometimes prematurely have thumbnails generated
Status:
RESOLVED: MOVED

Comments

Description ykui 2020-02-23 22:06:54 CET
Created attachment 9484 
Script for generating 100 images with random noise (to generate thumbnails for)

Sometimes, particularly when many files are saved quickly, having Thunar open in the same directory causes some thumbnails to be generated before the file is finished writing. 
This results in the thumbnail having a section of grey rows at the bottom. 
Refreshing or navigating away and back does not cause the thumbnails to be regenerated (for the changed, completely written file).

The issue is somewhat reproducible with the attached script, while having Thunar navigated to the same directory.
Comment 1 ykui 2020-02-23 22:08:11 CET
Created attachment 9485 
Sample of generated images showing some thumbnails having the incomplete grey bar
Comment 2 ykui 2020-02-23 22:09:35 CET
May or may not be related https://bugzilla.xfce.org/show_bug.cgi?id=16063
Comment 3 alexxcons editbugs 2020-02-24 17:13:06 CET
Thanks for reporting !

Are you interested in working on a fix? I can provide guidance, but its unlikely that I will have time to fix this myself for a while.

Help would be much appreciated !
Comment 4 ykui 2020-02-26 17:07:29 CET
Perhaps I could try, though I do not have high hopes. 
My main idea is to check the last modified date and delay (timeout? idle?) files that were modified less than a second ago. 
This would maybe affect large files like videos though (would it be a problem to not have thumbnails for those until they are completed/have gone a short time without being written to?)
Perhaps requiring that if a file is not in the cache (already has a thumbnail (?)) that it must wait a second or so, in case the problem is that the partial file completes writing before the thumbnail is generated, so that a new thumbnail is never requested. 

The less internals that would have to be touched the better though, dbus does not seem like a healthy past-time.
Comment 5 alexxcons editbugs 2020-02-26 23:18:26 CET
I would start looking at the thumbnail request sent by thunar. (thunar-thumbnailer.c/.h)

thunar_thumbnailer_queue_files is called in thunar_standard_view_request_thumbnails_real ... possibly some check is required to make sure that the file is "complete".
Not sure how a "is complete" check can be done. Possibly there is a md5 checksum or something similar.

You may want to check if there is some promising method in Thuna-file.h .. possibly "thunar_file_get_info" ?
Or possibly the realted gfile has that information: https://developer.gnome.org/gio/stable/GFile.html
Comment 6 Git Bot editbugs 2020-05-26 23:48:20 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/xfce/thunar/-/issues/281.

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
Comment 7 ykui 2020-05-27 11:33:09 CEST
Created attachment 9903 
Patch that largely appears to fix the issue for me.

I have been a bit busy so it took some time to get around to.
I have a probably not very clean patch that appears to fix the issue for me. 

It probably needs to be modified to be in line with whatever coding standars thunar/GLib/GTK follows.

There are also some comments regarding minor remaining issues.
Comment 8 ykui 2020-05-27 11:35:30 CEST
I do not really know how to use gitlab and the sign-in page for gitlab using github gives me a 404

Bug #16467

Reported by:
ykui
Reported on: 2020-02-23
Last modified on: 2020-05-27

People

Assignee:
Xfce Bug Triage
CC List:
2 users

Version

Version:
1.8.12

Attachments

Additional information