Skip to content

RFC: Expose User Requested Image Metadata #19973

@wpferguson

Description

@wpferguson

The Problem

  • lines of code - adding a new metadata field to exif.cc is 100 - 200 lines of code added to a file that is already 5000 lines of code. add highlight preservation modes for Canon/Olympus/Pentax #19375, Add support for extracting, storing, and filtering on Fujifilm Film Modes #19622
  • must be supported by exiv2 - Canon added Roll and Pitch data to the metadata several months ago. I extract and use it to auto straighten my images, but I have to use exiftool because exiv2 doesn't support it.
  • time to release (usability) - If I open an issue today (5.4. release date) the earliest I will see a released solution is 6 months. At the time a user opens an issue to get a new metadata field exposed is when they need it.
  • store in image table? - Should the metadata be stored in the image table. I struggled with this when I read Add support for extracting, storing, and filtering on Fujifilm Film Modes #19622. I looked at the information that was stored in the image table and realized that information is required by the modules to process the image. Storing a field such as Fujifilm Film Modes or Canon Picture Modes, which are how the included JPG is processed, in the image table serves no purpose for darktable since darktable can't apply processing based on this value. However, the user feels that they have a use and would like to have it. We just need to store it somewhere else (RFC: Functional Tagging #19971).

The Ideal Solution

  • The user wants a new piece of metadata
  • They lookup the exif tag information
  • They open the (nonexistent) add metadata tool and enter a label and the exif tag information
  • They hit enter and the add metadata tool figures out which engine to use, adds a field to the image information module and figures out where to store it so the user can access it.
  • The added metadata settings are saved so it's always available from now on.

The Possible Solution

When @phweyland upgraded the image information module he made it possible for Lua to add fields and register a callback to update them. I wrote a proof of concept script to test it and got it working.

I realize a script might not work for all because some users have problems installing the scripts. However, #19899 should fix that. I've already got it working so I'm confident it will be ready for 5.6. With that the solution becomes "built-in", with the exception of exiv2 and exiftool. The exiv2 library is included in darktable, so I just need to make it accessible from Lua. With the lua-scripts built in, we can set certain scripts to auto start and thus they just become part of darktable.

So with all of the above....

  • the user opens the add metadata module
  • they specify the exif tag and label and possibly engine to use.
  • add metadata adds a field to the image information display and the user can choose to make it visible or not
  • when an image is hovered the callback checks to see if the metadata value is cached or not. If not then it checks for a metadata tag and gets the value, then caches it. If no tag, then exiv2 or exiftool is invoked to get the value and it is saved as a tag and cached.
  • the user can access the metadata at darktable|metadata|<label>|<value>. The user can also access the variable $(CATEGORY[0,darktable|metadata|<label>]) which will give the value

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature: newnew features to addscope: DAMmanaging files, collections, archiving, metadata, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions