Am Montag, 31. Oktober 2016, 08:48:44 CET schrieb Tomas Sobek:
> Hi,
> How can I list all photos Darktable knows about, that have input profiles
> other than standard color matrix? I would like to get filenames of photos
> and corresponding input color profile names (or ICC filenames). I tried
> various approaches however I get always stuck on the data being somehow
> encoded. If someone could point me in the right place in the code I hope I
> should be able to work out the details. Here is what I tried so far:
> 
> a) Collect images module
> 
> Input profile information is not available there.

Right, collect knows nothing about these things.

> b) Side-car files (XMP)
> 
> Input profile information is encoded there, but I haven't worked out how to
> extract it.

[...]

> d) Look directly inside Darktable database
> 
> As per https://www.darktable.org/usermanual/ch01.html.php
> 
> "Darktable keeps image information in an sqlite database for fast access.
> The default location of that database file is “$HOME/.config/darktable/
> library.db”."
> 
> I can see data inside history table (op_params) being stored as BLOB. So
> again I would need to know how is it encoded in there.

XMP and the database keep the same binary blob. If you are able to write a 
small program (C would be best) you can relatively easily decode that: check 
that the module version is matching what your code knows and then cast the 
blob to dt_iop_colorin_params_t from src/iop/colorin.c:

typedef struct dt_iop_colorin_params_t
{
  dt_colorspaces_color_profile_type_t type;
  char filename[DT_IOP_COLOR_ICC_LEN];
  dt_iop_color_intent_t intent;
  int normalize;
  int blue_mapping;
} dt_iop_colorin_params_t;

If you want a more robust and generic approach you can use module 
introspection, but for a quick tool like this it's probably overkill.

If you need any more help you should ping me on IRC (#darktable on Freenode, 
webchat is available here: https://webchat.freenode.net/?channels=
%23darktable).

> Background:
> I am creating camera input profiles with ColorChecker target for specific
> difficult lighting situations. Since the colour checker LUT module is work
> in progress,

It's basically done.

> I am creating such profiles manually using Argyll CMS.
> Unfortunately my ICC profiles are currently displayed in random order in
> profiles drop-down list. This makes it quickly hard to work with.
> 
> I opened a new feature request which may or may not address the sort order
> (it's status is "Closed: invalid" but Tobias said he will have a look) -

It's also fixed already.

https://github.com/darktable-org/darktable/commit/
706985e2d8beebb12720415e0293bd2e014de3a2

> https://www.darktable.org/redmine/issues/11274 - While waiting I would like
> to keep tight control of the ICC profiles files. If I accidentally delete a
> profile in use, next time I open a photo that was using it, the profile is
> replaced with standard color matrix. I would like to avoid such mistakes. On
> the other hand I don't want to keep unused profiles in the list as it gets
> unwieldy. A script giving me overview of which photo is using which profile
> would be really helpful for this.
> 
> Any pointer in the right direction would be much appreciated.
> Cheers, Tomas

Tobias

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to