Bug 492148 - UI flicker when rating images or rescanning collection
Summary: UI flicker when rating images or rescanning collection
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Albums-IconView (show other bugs)
Version: 8.4.0
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-24 22:28 UTC by Freddie Witherden
Modified: 2024-09-01 13:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 8.5.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Freddie Witherden 2024-08-24 22:28:48 UTC
When one rates an image the UI flickers in the sense that the preview image for the file being rated momentarily disappears before immediately reappearing.  The same thing happens when tagging an image.  (I have observed this with metadata stored in XMP sidecar files but presume it happens in other modes too.)  A similar flicker occurs when one asks digikam to rescan or reprocess a collection (with each image flickering as it is rescanned assuming that image is visible on screen).

As a user I find this unnecessarily draws my attention away from what I'm doing (usually rating the next image) and so it would be nice if this could be avoided.  For most cases (tagging, rating, and geotagging which should not impact the preview displayed on screen this should be avoidable.
Comment 1 Maik Qualmann 2024-08-25 11:14:58 UTC
Since the modification date changes, it must be assumed that the image content may have changed as well. Therefore, we delete the image in the cache and initiate a reload, which leads to flickering.
You can deactivate the option to update the modification date in the digiKam metadata settings (the modification date then remains the same), then the thumbnail will not flicker.

Maik
Comment 2 Freddie Witherden 2024-08-25 11:41:31 UTC
(In reply to Maik Qualmann from comment #1)
> Since the modification date changes, it must be assumed that the image
> content may have changed as well. Therefore, we delete the image in the
> cache and initiate a reload, which leads to flickering.
> You can deactivate the option to update the modification date in the digiKam
> metadata settings (the modification date then remains the same), then the
> thumbnail will not flicker.
> 
> Maik

If the metadata is being written to the file that makes sense.  However, when XMP sidecar files are used all that changes is the modification date of the sidecar and not the image file itself.  If the view keeps track of the image modification date it can double check this before doing the reload.

But, even on a reload of the image does the thumbnail itself have to flicker?  Can double buffering not be used here to avoid having the thumbnail ever disappear?  So we allocate a new image/pixmap object, draw the thumbnail into it (or otherwise extract it), then swap it out for the current pixmap once everything is ready.
Comment 3 Maik Qualmann 2024-09-01 13:03:28 UTC
Git commit 8401b4c636cbdeecc1769a67c0f30c0b4731d078 by Maik Qualmann.
Committed on 01/09/2024 at 13:02.
Pushed by mqualmann into branch 'master'.

use buffered thumbnail pixmap cache when items are changed
FIXED-IN: 8.5.0

M  +14   -4    core/libs/database/models/itemthumbnailmodel.cpp
M  +24   -2    core/libs/threadimageio/fileio/loadingcache.cpp
M  +1    -0    core/libs/threadimageio/fileio/loadingcache.h
M  +32   -0    core/libs/threadimageio/thumb/thumbnailloadthread.cpp
M  +7    -0    core/libs/threadimageio/thumb/thumbnailloadthread.h

https://invent.kde.org/graphics/digikam/-/commit/8401b4c636cbdeecc1769a67c0f30c0b4731d078