Bug 434716

Summary: Serious Problems while rotating multiple Images with Synch Services (QMAP, Synology, etc.)
Product: [Applications] digikam Reporter: Sebastian Mai <sebastian.mai.1981>
Component: BatchQueueManager-CoreAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: critical CC: metzpinguin
Priority: NOR    
Version: 7.1.0   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 7.2.0
Sentry Crash Report:
Attachments: serious picture defect sample

Description Sebastian Mai 2021-03-21 12:33:46 UTC
SUMMARY


STEPS TO REPRODUCE
1. 
Select as fast as possible several images in the preview gallery, (In my case it was enough to select around 5-10 big jpged files)  . 

2. 
try to rotate them with the quick rotate button to the left or the right. repeat that several times.
3. 

OBSERVED RESULT
Under some unknown circumstances the rotated images get just broken with a grey foreground color overwritten partially (usually half of the picture) instead of the picture. The picture is then saved with the defect and cannot be restored.
EXPECTED RESULT
Even the fast working / mass editing of big jpges has to work correctly. Otherwise the program is useless because i just brake my originals.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I guess its a combination of several big jpegs 20 MB in size and also a program for synching files in the background which causes the trouble.
Maybe you need to use dropbox or something like that and many hundreds of big pictures to reproduce the issue.
Comment 1 Sebastian Mai 2021-03-21 12:38:05 UTC
Created attachment 136915 [details]
serious picture defect sample

attached a screenshot of one of the broken files :(
Comment 2 Maik Qualmann 2021-03-21 16:01:48 UTC
We cannot tell whether a service is running in the background that is backing up files in the meantime. You should stop such a service while digiKam is running. The JPEG rotation is carried out on temporary files. I see a problem in the code here. That we already know from the BQM. This could lead to temporary files being used twice if several tasks are running at the same time. I will fix this.

Maik
Comment 3 Maik Qualmann 2021-03-21 16:09:03 UTC
Git commit 3239fb4f3626f882164712d5c41a0b5278f5af5d by Maik Qualmann.
Committed on 21/03/2021 at 16:08.
Pushed by mqualmann into branch 'master'.

make temporary file more unique even for multiple tasks
FIXED-IN: 7.2.0

M  +2    -1    NEWS
M  +4    -1    core/libs/jpegutils/jpegutils.cpp
M  +3    -3    core/utilities/queuemanager/manager/batchtool.cpp

https://invent.kde.org/graphics/digikam/commit/3239fb4f3626f882164712d5c41a0b5278f5af5d