Replies: 2 comments 2 replies
-
I am not familiar with neofinder nor with these XMP fields you've mentioned. Adding custom fields isn't hard and the example should get you started. To use Mako you need to understand a bit of python (the control logic is a subset of python) and you need to understand the field you're trying to add. For example,
The Mako file is just an XMP file (or an HTML file or a JSON file or anything you want it do be). The Mako control logic (tags beginning with <expressionmedia:UserFields>
<rdf:Seq>
<rdf:li>pDuration=nxCTpDuration</rdf:li>
</rdf:Seq>
</expressionmedia:UserFields> I'm happy to provide some pointers if I better understand what fields you're trying to include and where that data should come from but I don't use/know neofinder so can't comment on specifics of it's desired format. |
Beta Was this translation helpful? Give feedback.
-
The Reference the help for the sidecars template option: --sidecar-template <MAKO_TEMPLATE_FILESIDECAR_FILENAME_TEMPLATEOPTIONS> Create a custom sidecar file for each photo exported with user provided Makotemplate (MAKO_TEMPLATE_FILE). MAKO_TEMPLATE_FILE must be a valid Mako template (see https://www.makotemplates.org/). The template will passed the following variables: photo (PhotoInfo object for the photo being exported), sidecar_path (pathlib.Path object for the path to the sidecar being written), and photo_path (pathlib.Path object for the path to the exported photo. SIDECAR_FILENAME_TEMPLATE must be a valid template string (see Templating System in help) which will be rendered to generate the filename of the sidecar file. The {filepath} template variable may be used in the SIDECAR_FILENAME_TEMPLATE to refer to the filename of the photo being exported. OPTIONS is a comma-separated list of strings providing additional options to the template. Valid options are: write_skipped, strip_whitespace, strip_lines, skip_zero, catch_errors, none. write_skipped will cause the sidecar file to be written even if the photo is skipped during export. If write_skipped is not passed as an option, the sidecar file will not be written if the photo is skipped during export. strip_whitespace and strip_lines indicate whether or not to strip whitespace and blank lines, respectively, from the resulting sidecar file. skip_zero causes the sidecar file to be skipped if the rendered template is zero-length. catch_errors causes errors in the template to be caught and logged but not raised. Without catch_errors, osxphotos will abort the export if an error occurs in the template. For example, to create a sidecar file with extension .xmp using a template file named 'sidecar.mako' and write a sidecar for skipped photos and strip blank lines but not whitespace: --sidecar-template sidecar.mako '{filepath}.xmp' write_skipped,strip_lines. To do the same but to drop the photo extension from the sidecar filename: --sidecar-template sidecar.mako '{filepath.parent}/{filepath.stem}.xmp' write_skipped,strip_lines. If you are not passing any options, you must pass 'none' as the last argument to --sidecar-template: --sidecar-template sidecar.mako '{filepath}.xmp' none. For an example Mako file see https://raw.githubusercontent.com/RhetTbull/osxphotos/main/examples/custom_sidecar.mako](https://raw.githubusercontent.com/RhetTbull/osxphotos/main/examples/custom_sidecar.mako) |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm looking to build out a sidecar that will be readable by Neofinder. I'm not familiar with Mako and wondering how to form some of the <%def> block names. eg I looked at an xmp file generated from neofinder and it has a photoshop:TransmissionReference tag, would this translate to <%def name="photoshop_transmission_reference(jobId)"> or something else? Is there a way to find out all the legally formed names or to test if one is present?
How would this work for custom fields in the xmp like the following:
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions