Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ui] fix thumbnail cache bugs #1893

Merged
merged 2 commits into from
Feb 16, 2023
Merged

[ui] fix thumbnail cache bugs #1893

merged 2 commits into from
Feb 16, 2023

Conversation

mugulmd
Copy link
Contributor

@mugulmd mugulmd commented Feb 13, 2023

Description

In this PR we fix several bugs related to the thumbnail cache mechanism.

Endless request loop

We fix a problem that can occur with the thumbnail cache when input images cannot be read:
since each image delegate has a Timer that will send a new request every 5 seconds until a thumbnail can be loaded, in the case of images that cannot be read these requests will be sent endlessly.

The proposed fix is to stop the Timer after the 1st request, since it is the only one that is actually useful for preventing unwanted behaviour from the QML engine.

Reload image after modification

Another problem that we fixed is that when an image was loaded once, then modified for any reason and then reloaded later on, its corresponding thumbnail will not be updated.

The proposed fix is to remove a thumbnail if its corresponding image has been modified after the thumbnail creation: this way, a new thumbnail will be generated, and it will match the modified image.

@mugulmd mugulmd requested a review from fabiencastan February 13, 2023 14:54
@mugulmd mugulmd self-assigned this Feb 13, 2023
@mugulmd mugulmd marked this pull request as draft February 14, 2023 14:08
@mugulmd mugulmd changed the title [ui] thumbnail cache: avoid infinite looping when image cannot be read [ui] fix thumbnail cache bugs Feb 14, 2023
@mugulmd mugulmd marked this pull request as ready for review February 14, 2023 17:05
@fabiencastan fabiencastan marked this pull request as draft February 14, 2023 20:52
@mugulmd mugulmd force-pushed the mug/fixThumbnailCache branch from 39979a9 to 68d1172 Compare February 15, 2023 10:26
@mugulmd mugulmd marked this pull request as ready for review February 16, 2023 10:43
@fabiencastan fabiencastan added this to the Meshroom 2023.1.0 milestone Feb 16, 2023
@fabiencastan fabiencastan merged commit 35954a7 into develop Feb 16, 2023
@fabiencastan fabiencastan deleted the mug/fixThumbnailCache branch February 16, 2023 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants