Bug 391891 - Digikam does not warn if metadata could not be written because a file is read-only
Summary: Digikam does not warn if metadata could not be written because a file is read...
Status: RESOLVED DUPLICATE of bug 220204
Alias: None
Product: digikam
Classification: Applications
Component: Metadata-Engine (show other bugs)
Version: 7.0.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-15 16:28 UTC by MarcP
Modified: 2022-12-15 11:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MarcP 2018-03-15 16:28:35 UTC
When applying a tag to a selection of pictures in digikam, it is possible that some files are read only, and therefore the metadata won't be written to them. I noticed that when launching digikam from a shell. 

I think Digikam should warn the user that the file could not be modified, so you can act accordingly (give permissions, etc.).
Comment 1 caulier.gilles 2018-03-15 16:39:47 UTC
Which file system do you use exactly ?

Gilles Caulier
Comment 2 MarcP 2018-03-15 16:46:55 UTC
My pictures are stored in ext4 hard drive in a debian (jessie) server, shared through a samba (4.2.14) network share, and mounted as a network drive in Windows 10.
Comment 3 caulier.gilles 2018-03-15 17:11:09 UTC
Under Windows, if you go with a console (cmd) in the directory an use "dir" to list all contents + properties, what do seen ?

Gilles Caulier
Comment 4 MarcP 2018-03-15 17:21:37 UTC
Not much, just columns for the date, the hour, the file size, the file name, and the total size of the folder at the bottom.

Here's an example: https://pastebin.com/dpdaM9dW
Comment 5 caulier.gilles 2018-03-15 18:24:42 UTC
There is certainly an option to pass to dir to show the details :

https://jpsoft.com/help/dir.htm

Gilles Caulier
Comment 6 MarcP 2018-03-15 18:28:52 UTC
I think way to see permissions in windows is using the command icacls.

Anyway, I corrected the permissions in the debian server as soon as I saw the read-only error in digikam's console, so I cannot show you exactly how it's seen from windows. But at least it seems that digikam is aware that the file could not be written, so I guess a warning could be shown in the user interface.
Comment 7 MarcP 2019-04-26 22:11:39 UTC
Just a heads up. This is an issue in linux too. If you write some metadata to a read-only file, digikam does not warn you, makes the changes to the database, but not to the file. If you re-read the metadata from digikam, those changes will revert.

In the console, I can see the following error: 

Digikam::MetaEngine::Private::printExiv2ExceptionError: Cannot save metadata using Exiv2   (Error # 10 :  /media/sshfs/retropie/media/usb2/Fotos/Fotos/2019-04-22 Aplec/P1230088.JPG: Failed to open file (w+b): Permission denied (errno = 13)

But in the main interface, the problem goes unnoticed. I think this is currently the only situation where the metadata between the database and the pictures can be out of sync.

In my opinion, just showing a warning (e.g. "Changes could not be saved.") at the progress bar at the bottom would be helpful for detecting these situations.
Comment 8 caulier.gilles 2020-08-04 08:09:13 UTC
digiKam 7.0.0 stable release is now published:

https://www.digikam.org/news/2020-07-19-7.0.0_release_announcement/

We need a fresh feedback on this file using this version.

Best Regards

Gilles Caulier
Comment 9 MarcP 2020-08-04 09:26:38 UTC
This problem is still present.
Comment 10 Maik Qualmann 2022-12-15 11:06:27 UTC

*** This bug has been marked as a duplicate of bug 220204 ***