• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

The "caption" field is read using getFormattedMetadata, but set with setRawMetadata?

Explorer ,
Jul 18, 2021 Jul 18, 2021

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?

TOPICS
SDK

Views

109

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 18, 2021 Jul 18, 2021

Copy link to clipboard

Copied

For such fields, it is safe to read them getFormattedMetadata().  The documentation is misleading in this case.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

LATEST

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines