SUMMARY If a photo is read-only (e.g. -r--r--r--) but in a writable directory and digiKam attempts to write metadata to it, it will succeed (apparently by removing the file first). If I set "Write to XMP sidecar for read-only item only", it will acknowledge the photo is read-only by creating the sidecar, but it will still overwrite the original. If I make the directory read-only, the photo is protected, but digiKam cannot create sidecars. It can, however, modify them, once they exist. STEPS TO REPRODUCE 1. Create a read-only photo in a writable directory 2. Make sure Metadata>Sidecars>Write to sidecar files is enabled 3. Make sure Metadata>Sidecars>Write to XMP sidecar for read-only item only is selected 4. Make sure Metadata>Rotation>Rotate by changing the content if possible is selected 5. Make sure Metadata>Rotation>Write flag to metadata if possible is enabled (I assume this is necessary to achieve the expected result, but it is not necessary to reproduce the observed result) 6. Rotate the photo OBSERVED RESULT The photo is rotated by replacing the read-only file with a modified one and an XMP sidecar is created EXPECTED RESULT The photo is rotated by setting a flag in the metadata, which is written to an XMP sidecar SOFTWARE/OS VERSIONS KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.105.0 Qt Version: 5.15.9 ADDITIONAL INFORMATION As a workaround, I've made digiKam create sidecars for the photos I'm protecting, restored those photos from a backup, then made those photos and their parent directories read-only. I can now manage metadata in the sidecar without modifying the photo.
Hi, Your are right. The image is duplicated with Exiv2 shared library in charge of low level metadata file management. A temp file is created and if metadata are patched fine, original is removed. Normally the files access properties must be restored with the new file. Gilles Caulier
I can't reproduce the problem here with digiKam-8.1.0. The image is not changed when rotating (MD5 checksum checked) and the read flags are not changed. The image rotates in the digiKam view because the orientation flag is written correctly to sidecar and DB. There were some changes here for digiKam-8.0.0. Maik
Ok, I was wrong, used an image with broken JPG data. Maik
Git commit 232218b65221ce49b20a921adad0bed67644a745 by Maik Qualmann. Committed on 07/05/2023 at 17:34. Pushed by mqualmann into branch 'master'. fix rotation of read only files FIXED-IN: 8.1.0 M +1 -1 NEWS M +2 -1 core/libs/fileactionmanager/fileworkeriface.cpp https://invent.kde.org/graphics/digikam/commit/232218b65221ce49b20a921adad0bed67644a745