Skip to content

Filter certain persons to add to keywords template on export #1384

Answered by oPromessa
oPromessa asked this question in Q&A
Discussion options

You must be logged in to vote

Testing out with the filter example function and it works!!! Hopefully will not delay much the export ;)

TOML file

exiftool = true
exiftool_merge_keywords = true
exiftool_merge_persons = true
keyword_template = [
    "{person|sort|function:persons.py::myfilter}",
]

Python file:

""" Example of using a custom python function as an osxphotos template filter 

    Use in formath:
    "{template_field|template_filter.py::myfilter}"

    Your filter function will receive a list of strings even if the template renders to a single value.  
    You should expect a list and return a list and be able to handle multi-value templates like {keyword}
    as well as single-value templates like {original_…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RhetTbull
Comment options

Answer selected by oPromessa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants