Copy link to clipboard
Copied
I need to read and write the "caption" metadata field. However, while it works, I don't trust the safety of an operation that involves...
local caption = photoSource:getFormattedMetadata('caption')
photoTarget:setRawMetadata('caption',caption)
... because the API docs clearly say:
Retrieves display-formatted metadata from this photo. Metadata is formatted as is shown in the metadata panel. The returned value strings are formatted for display; you should not attempt to parse them.
So, how can I go about getting a "raw" caption, not - possibly - mangled via "formatting", whatever that entails?
Copy link to clipboard
Copied
For such fields, it is safe to read them getFormattedMetadata(). The documentation is misleading in this case.
Copy link to clipboard
Copied
That's what I went with, and it seems to be just fine - I managed to build a plugin copying a whole set of captions from one collection to another, copy-paste style 🙂 - but I wonder why on $Planet can some fields NOT be read via getRawMetadata, while they can be set with setRawMetadata?