Bug 447395 - Digikam freezes completely if too many pictures are processed in the Adjust Time & Date plugin
Summary: Digikam freezes completely if too many pictures are processed in the Adjust T...
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-Generic-TimeAdjust (other bugs)
Version First Reported In: 7.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-22 20:54 UTC by MarcP
Modified: 2021-12-28 07:46 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MarcP 2021-12-22 20:54:07 UTC
SUMMARY
I noticed that digikam 7.4 (stable version) freezes completely if too many photos are processed in the Adjust Time and Date plugin.

A bit of context: one of my relatives didn't adjust the camera date on some of her trips, so around 3000 pictures had incorrect dates. I thought of selecting all of them, using the Adjust Time & Date plugin and correct the date by adding the number of days and hours necessary. However, if I selected more than 200-300 pictures at a time, digikam just froze in the middle of the process. It is something gradual, at about 170 pictures, digikam shows some stutters every now and then but complete successfully, but at more than 200, it freezes at some point and has to be force closed.

The pictures were taken with a SONY ILCE-5000 camera (although that's probably irrelevant) and take up from 5 to 6MB each. I was just writing the date to the "EXIF:original" timestamp. That was in a windows laptop with a SSD drive, and everything (database and pictures) are stored locally.

STEPS TO REPRODUCE
1. Select more than 200 pictures, 5MB each.
2. Use the Time and Date plugin to adjust the date.
3. Click on Apply

OBSERVED RESULT
The process starts, but it stutters and finally freezes the whole program.

EXPECTED RESULT
The process should continue until it finishes.

SOFTWARE/OS VERSIONS
Windows: Digikam 7.4 (final) in Windows 10 21H2 64bit
Comment 1 Maik Qualmann 2021-12-22 20:59:21 UTC
Yes, I know the problem. The calculation of the preview of the new time stamp is not carried out in a thread. With many images it actually takes a long time, but the GUI would be available again afterwards.

Maik
Comment 2 MarcP 2021-12-22 21:01:17 UTC
Oh ok, I'm glad you are already aware of the issue.
Comment 3 Maik Qualmann 2021-12-22 21:05:18 UTC
Yes, we also have to run these previews in the list view in a thread. Some QDateTime operations really take a long time, Qt justifies it with complicated calendar functions, calculation of summer / winter time, etc.

Maik
Comment 4 Maik Qualmann 2021-12-27 18:40:26 UTC
Git commit 25ca98a468b8b6e529eb83a7a142e130bca18f21 by Maik Qualmann.
Committed on 27/12/2021 at 18:39.
Pushed by mqualmann into branch 'master'.

change section resize mode for more speed

M  +1    -1    core/dplugins/generic/metadata/timeadjust/timeadjustlist.cpp

https://invent.kde.org/graphics/digikam/commit/25ca98a468b8b6e529eb83a7a142e130bca18f21
Comment 5 Maik Qualmann 2021-12-27 18:47:31 UTC
I'm currently working on a preview task for the Time Adjust Tool. I noticed that a QTreeWidget is extremely slow when the section resize mode is set to QHeaderView::ResizeToContents and text is changed in the rows.

Maik
Comment 6 Maik Qualmann 2021-12-28 07:46:22 UTC
Git commit c94f6c7c53b46ff228018cfb196ff8ac6f6ff0b1 by Maik Qualmann.
Committed on 28/12/2021 at 07:44.
Pushed by mqualmann into branch 'master'.

add preview thread to the Time Adjust Tool
FIXED-IN: 7.5.0

M  +1    -1    NEWS
M  +86   -204  core/dplugins/generic/metadata/timeadjust/timeadjustdialog.cpp
M  +10   -30   core/dplugins/generic/metadata/timeadjust/timeadjustdialog.h
M  +57   -39   core/dplugins/generic/metadata/timeadjust/timeadjustlist.cpp
M  +11   -6    core/dplugins/generic/metadata/timeadjust/timeadjustlist.h
M  +104  -28   core/dplugins/generic/metadata/timeadjust/timeadjusttask.cpp
M  +38   -4    core/dplugins/generic/metadata/timeadjust/timeadjusttask.h
M  +172  -18   core/dplugins/generic/metadata/timeadjust/timeadjustthread.cpp
M  +29   -6    core/dplugins/generic/metadata/timeadjust/timeadjustthread.h
M  +1    -1    core/libs/dplugins/widgets/ditemslist_view.cpp
M  +9    -23   core/libs/timeadjust/timeadjustcontainer.cpp
M  +1    -2    core/libs/timeadjust/timeadjustcontainer.h

https://invent.kde.org/graphics/digikam/commit/c94f6c7c53b46ff228018cfb196ff8ac6f6ff0b1