Version 0.50.0 with updated template engine

This commit is contained in:
Rhet Turnbull
2022-05-28 08:12:16 -07:00
parent 0a973d67f9
commit 175d7ea223
27 changed files with 700 additions and 245 deletions

View File

@@ -1,3 +1,3 @@
""" version info """
__version__ = "0.49.9"
__version__ = "0.50.0"

Binary file not shown.

View File

@@ -178,6 +178,14 @@ A powerful feature of Photos is that it uses machine learning algorithms to auto
`osxphotos export /path/to/export --exiftool --keyword-template "{label}"`
## Removing a keyword during export
If some of your photos contain a keyword you do not want to be added to the exported file with `--exiftool`, you can use the template system to remove the keyword from the exported file. For example, if you want to remove the keyword "MyKeyword" from all your photos:
`osxphotos export /path/to/export --exiftool --keyword-template "{keyword|remove(MyKeyword)}" --replace-keywords`
In this example, `|remove(MyKeyword)` is a filter which removes `MyKeyword` from the keyword list of every photo being processed. The `--replace-keywords` option instructs osxphotos to replace the keywords in the exported file with the filtered keywords from `--keyword-template`.
**Note**: When evaluating templates for `--directory` and `--filename`, osxphotos inserts the automatic default value "_" for any template field which is null (empty or blank). This is to ensure that there's never a null directory or filename created. For metadata templates such as `--keyword-template`, osxphotos does not provide an automatic default value thus if the template field is null, no keyword would be created. Of course, you can provide a default value if desired and osxphotos will use this. For example, to add "nolabel" as a keyword for any photo that doesn't have labels:
`osxphotos export /path/to/export --exiftool --keyword-template "{label,nolabel}"`