Bug 487920

Summary: Adjust DateTime is unnecesarily slow - it re-reads all the images all the time
Product: [Applications] digikam Reporter: fotograaf <fotograaf>
Component: Plugin-Generic-TimeAdjustAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: metzpinguin
Priority: NOR    
Version First Reported In: 8.4.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 8.4.0
Sentry Crash Report:

Description fotograaf 2024-06-02 12:14:01 UTC
Adjust dateTime for a number of images is slow, slower than necessary.

1. It reads all the images, entirely.  If you are working with Raws on a network drive, this takes a long time.
2. When you change the radiobutton 'timestamp used', it re-reads them again.  


Problems:
1) reading all of this is not needed. All the info is already in the database!  It was already read on importing the images. There is no need to re-read it from the original image.

2) reading the entire 38 megabytes of a rawfile just to read the date&time?  That is too much. Just read what is actually needed.

3) re-reading all the information when you click a different radio-button? Not needed because the data was already read and available.
Comment 1 fotograaf 2024-06-02 12:15:29 UTC
To add insult to unjury... when you adjust the amount of time to add/substract... It read all the images again.
Comment 2 Maik Qualmann 2024-06-02 12:50:36 UTC
Metadata is only read if you use the timestamp "EXIF/IPTC/XMP" option, as these are not in the database. The preview process for the timestamps that is started is a separate thread and can be aborted at any time, you do not have to wait until it is complete.
In case of applying the timestamp changes, Exiv2 or ExifTool must load the entire file, as it is completely rewritten. Please see the ExifTool FAQ for more information. When adding or subtracting time, most users want to see how it affects the result.

Maik
Comment 3 Maik Qualmann 2024-06-02 17:45:41 UTC
Git commit b720575dd849f0e665a925d70e535083797e4a96 by Maik Qualmann.
Committed on 02/06/2024 at 17:44.
Pushed by mqualmann into branch 'master'.

add cache for the source timestamp
FIXED-IN: 8.4.0

M  +1    -1    NEWS
M  +3    -0    core/dplugins/generic/metadata/timeadjust/timeadjustdialog.cpp
M  +24   -3    core/dplugins/generic/metadata/timeadjust/timeadjustthread.cpp
M  +4    -0    core/dplugins/generic/metadata/timeadjust/timeadjustthread.h
M  +14   -0    core/libs/timeadjust/timeadjustsettings.cpp
M  +1    -0    core/libs/timeadjust/timeadjustsettings.h

https://invent.kde.org/graphics/digikam/-/commit/b720575dd849f0e665a925d70e535083797e4a96