Closed asielen closed 3 years ago
interesting. Didn't know about config files.
@asielen Can you point me to a custom config file and a file to test on? I'd probably want to add it into tests
I like the config file idea, though I might add it as an attribute and not in the constructor.
Here's the official example custom config: https://exiftool.org/config.html
I second putting it in the constructor – it's a critical component if you're working with custom namespaces/tags.
I initially tried it as an attribute, the challenge is that it always has to be the first argument after the executable. it seemed cleaner to put it in the constructor also because using the config file is global.
I reviewed the code, and I really don't think params
should be an argument on get_metadata
and get_metadata_batch
. After all, they're both sent into the execute_json
call the same way. It's probably better for the caller to combine and send it once.
Can you remove the params change and I'll merge the config_file change
ok, well, thanks for your config_file contribution @asielen I'll merge the PR as is. Just know that the params=
may or may not make it to the 0.5 build (currently being actively developed on the branch https://github.com/sylikc/pyexiftool/tree/v0.5.x-py3-refactor )
To allow for config files (https://exiftool.org/config.html) I made an update to the start method. Config files allow for the creation and setting of custom metadata fields. The limitation though is that if using a config file, it has to be the first argument.
Additionally added an optional parameter to get_metadata which can be used for exporting different formats. eg using the -struct tag to see the hierarchy of the metadata rather than the simplified version.