Bug 379511 - Introduce additional sidecar types and fix bug in mime setup [patch]
Summary: Introduce additional sidecar types and fix bug in mime setup [patch]
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-Metadata (show other bugs)
Version: 5.6.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-04 16:05 UTC by Simon
Modified: 2020-07-26 08:26 UTC (History)
1 user (show)

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


Attachments
Introduce additional sidecar types and fix bug in mime setup (20.00 KB, patch)
2017-05-04 16:05 UTC, Simon
Details
Introduce additional sidecar types and fix bug in mime setup - 2 (19.91 KB, patch)
2017-05-04 16:10 UTC, Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon 2017-05-04 16:05:52 UTC
Created attachment 105344 [details]
Introduce additional sidecar types and fix bug in mime setup

We already consider *.xmp files when renaming/moving/copying/... files, but some programs use custom extension for their metadata. To be honest, I only know of Rawtherapee's *.pp3 but that is reason enough.

Therefore I introduced an additional field to the mime setup page for sidecar extensions. In contrast to the others, these files won't be registered in the database, but considered when doing IO operations.

In the process I found an inconsistency that can lead to erroneous behaviour: In the GUI the user is told to use spaces to separate the extensions. The parsing function accepts either semicolons or spaces, but not both. The function that populates the input fields with existing extension inserts them with semicolons. So if you add a new extension ("ex1;ex2" -> "ex1;ex2 ex3") it won't be registered as a new extension but as a modification: "ex2" -> "ex2 ex3".
As extensions can't (well shouldn't) contain spaces, I changed the parsing function to separate on both semicolons and spaces and adapted the explanation in the GUI.

Also I changed to icons such that all mime icons are colored (not monochrome) according to the breeze-icons guidelines.

As an aside: During renames this causes obviously failing thumbnail lookups for the sidecar files (was already the case for *.xmp). This is already addressed in my other patch about renaming.
Comment 1 Simon 2017-05-04 16:10:56 UTC
Created attachment 105345 [details]
Introduce additional sidecar types and fix bug in mime setup - 2
Comment 2 caulier.gilles 2017-05-04 21:13:34 UTC
Simon,

the way to host sidecar mime with Setup Type Mime is not the right one.

The Setup Type Mime is to register mime of items committed in DB. It's not the case of sidecar files. There are parsed by metadata engine if Setup Metadata option is turned on. I recommend to move sidecar type mime in Setup Metadata panel.

The way to handle sidecar in located in libs/dmetadata. In fact it's done internally by Exiv2, as i remember, but i'm not sure to 100%. At least check meta engine code about read and write from/to files.

Gilles
Comment 3 Simon 2017-05-04 21:42:13 UTC
My patch does not touch how metadata is handled and I don't intend to. This is only for file operations, i.e. dio.cpp. There currently on any operation it is checked whether a *.xmp file is present (via DMetadata::hasSidecar and DMetadata::hasSidecar). I extended this check to include the manually provided extensions.

I will move out the part of the patch that fixes the bug in the mime setup to another issue and move this setting to metadata setup. However I am not quite sure where to place it. It is separate from all the metadata settings, as it does not concern handling metadata within digiKam. So maybe add a new tab even though it is just one setting?
Comment 4 caulier.gilles 2017-05-06 05:43:46 UTC
Hi Simon,

yes a new tab in Metadata panel will be fine to host this kind of settings.

In fact i will see a dedicated tab for all sidecar settings. There are many entries in bugzilla about sidecars management.

So, in "Behavior" tab, moving :

- Read from sidecar files
- Write from sidecar files + combo options 

... To the new "Sidecar Files" tab will be logic.

I recommend to put a tip label in "Reading and Writing" group-box to indicate that sidecar options are now placed in a dedicated tab.

Gilles
Comment 5 caulier.gilles 2017-05-06 05:47:25 UTC
Note : There is an entry in bugzilla about the all sidecar files support.

Look here : https://bugs.kde.org/show_bug.cgi?id=193232

Gilles
Comment 6 Simon 2017-05-06 08:59:03 UTC
Ok, I will do that and follow up in the linked issue as it is exactly about this issue: Closing this issue as duplicate
For the bug about separators refer to https://bugs.kde.org/show_bug.cgi?id=379526 (fixed already).

*** This bug has been marked as a duplicate of bug 193232 ***
Comment 7 caulier.gilles 2020-07-26 08:26:23 UTC
Fixed with #193232