Custom sidecars #1133
Replies: 3 comments 5 replies
-
Is it guaranteed that the photo is already exported when the sidecar template is rendered? Having the exported images available may be useful in some situations. |
Beta Was this translation helpful? Give feedback.
-
I've refactored the
|
Beta Was this translation helpful? Give feedback.
-
In v0.62.0 I've changed the way this works to allow named options instead of the boolean options.
|
Beta Was this translation helpful? Give feedback.
-
@neilpa suggested a new feature (#1123) to allow custom sidecars. This is now implemented in v0.61.0.
Custom sidecars can be defined using a Mako template. The Mako sidecar template is passed three variables:
There are three example Mako sidecars in the examples directory:
Because the PhotoInfo object is available to the sidecar template, this last example is as simple as:
${photo.json(shallow=False, indent=4)}
This is definitely a niche option but it might be very useful for creating and sharing sidecars for specific apps. If you create any sidecars that might be useful for other osxphotos users please share them here.
Note that version 0.61.0 has one potentially breaking change if you
--report report.csv --append
to append to a CSV formatted report as the report now includes a new column nameuser_sidecar
so I suggest you archive your existing report and create a new one. JSON and SQlite reports should continue to work fine (but will include the new field for all added data).You can create multiple sidecars by repeating the
--sidecar-template
option. The generated sidecars are fully integrated into--update
,--cleanup
, and--report
options however, you must specify in the--sidecar-template
options the behavior for--update
. The two options currently available are to skip the sidecar if the photo is skipped or to regenerate the sidecar if the photo is skipped. Unlike with the built in sidecars, osxphotos does not know about the contents of the sidecar and thus cannot determine at run time whether a specific sidecar should be updated. Thus if you use custom sidecars with--update
, you may increase the run time of current export sets as the sidecars might be generated for every photo every time the export is run. Seeosxphotos help export sidecar-template
for additional information on usage.Beta Was this translation helpful? Give feedback.
All reactions