Discussion:
[digikam] [Bug 397340] New: Update image file timestamps if metadata is written to sidecar file
Add Reply
Kristian Karl
2018-08-10 12:29:54 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

Bug ID: 397340
Summary: Update image file timestamps if metadata is written to
sidecar file
Product: digikam
Version: unspecified
Platform: Other
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: Metadata-Sidecar
Assignee: digikam-bugs-***@kde.org
Reporter: ***@gmail.com
Target Milestone: ---

Created attachment 114391
--> https://bugs.kde.org/attachment.cgi?id=114391&action=edit
Suggested patch

As a user I would expect that Digikam during startup would rescan images when
following settings are enabled:
- "Update file timestamp when files are modified"
- "Rescan file when files are modified"
- "Write to sidecar files (Write to XMP sidecar only)

But since the only the sidecar file is modified, no changes will be detected
for those affected images during startup.

A suggested solution might be that when Digikam saves metadata only to the
sidecar file, also, the timestamp of the image file is updated.

I added a suggested patch that would implement the above.
--
You are receiving this mail because:
You are watching all bug changes.
Simon
2018-08-10 12:34:12 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

Simon <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com

--- Comment #1 from Simon <***@gmail.com> ---
I think this should happen on the scanner side, i.e. given those settings the
scanner should check the sidecar timestamp and rescan if it changed. Modifying
the timestamp on files that weren't actually changed is not ideal (e.g. for
sync/backup tools).
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-08-10 12:37:47 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

***@gmail.com changed:

What |Removed |Added
----------------------------------------------------------------------------
Summary|Update image file |Update image file
|timestamps if metadata is |timestamps if metadata is
|written to sidecar file |written to sidecar file
| |[patch]
CC| |***@gmail.com
--
You are receiving this mail because:
You are watching all bug changes.
Kristian Karl
2018-08-10 13:16:25 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #2 from Kristian Karl <***@gmail.com> ---
I went for a solution that was easy enough to implement.

I'm not sure if any data for sidecar files like, hash, size or modification
times are saved to the database?

I agree that the changing timestamps on files that are not actually changed is
not ideal.
--
You are receiving this mail because:
You are watching all bug changes.
Maik Qualmann
2018-08-10 17:46:33 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

Maik Qualmann <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com

--- Comment #3 from Maik Qualmann <***@gmail.com> ---
This is part of bug 339342 and bug 380341. In fact, I have already thought of
the same solution as Kristian. But I absolutely agree with Simon that the
modification date should not be changed if the file is unchanged. However, the
modification date of the sidecar file is not in the database. It would be
necessary to add a column for the modification date of a sidecar file in the
Images table of the database.

Maik
--
You are receiving this mail because:
You are watching all bug changes.
Maik Qualmann
2018-08-12 18:46:22 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #6 from Maik Qualmann <***@gmail.com> ---
Gilles, how do you see that? Add additional modification date of the sidecar
file in the DB? Or adjust the file modification date of the image file? I do
not see another solution.

Maik
--
You are receiving this mail because:
You are watching all bug changes.
Kristian Karl
2018-08-12 17:55:32 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #4 from Kristian Karl <***@gmail.com> ---
I'm using my patch as a work-around for now.

Sync'd metadata is a bit more important to me, than the significant drawback of
increased backup times.
--
You are receiving this mail because:
You are watching all bug changes.
Kristian Karl
2018-08-12 18:10:53 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #5 from Kristian Karl <***@gmail.com> ---
If you don't mind. I can try to have a go at suggesting a new patch, where the
modification timestamp of the sidecar file is stored in the database (as Maik
suggested) and used.

I guess it will take me a week to do that.
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-08-13 04:13:29 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #7 from ***@gmail.com ---
Maik,

Your last Q is for me ???

Gilles
--
You are receiving this mail because:
You are watching all bug changes.
Maik Qualmann
2018-08-13 04:59:45 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #8 from Maik Qualmann <***@gmail.com> ---
Yes, Gilles. But I have another idea. If writing is only activated to sidecar,
the modification date of the sidecar file will be written to the DB instead of
the image. That would save us any changes to the DB.

Maik
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-08-13 07:58:44 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #9 from ***@gmail.com ---
Maik,

Yes, this last idea is sound better. So the file modification time-stamp in DB
is a resume of item or xmp sidecar change. One entry in DB for both. Right ?

What's happen if image change and not xmp sidecar, and if we write to xmp side
car only ? This case cannot be managed ?

Gilles
--
You are receiving this mail because:
You are watching all bug changes.
Maik Qualmann
2018-08-13 12:56:13 UTC
Reply
Permalink
Raw Message
https://bugs.kde.org/show_bug.cgi?id=397340

--- Comment #10 from Maik Qualmann <***@gmail.com> ---
(In reply to caulier.gilles from comment #9)
Post by b***@kde.org
Maik,
Yes, this last idea is sound better. So the file modification time-stamp in
DB is a resume of item or xmp sidecar change. One entry in DB for both.
Right ?
Yes exactly.
Post by b***@kde.org
What's happen if image change and not xmp sidecar, and if we write to xmp
side car only ? This case cannot be managed ?
If digiKam changes the image data also metadata will be written, that's ok. But
if the image is changed externally, we would not notice, because we only look
for the sidecar. Backup excepted, the solution of Karl is probably the best.

Maik
--
You are receiving this mail because:
You are watching all bug changes.
Loading...