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

Assert Failed Packed when trying to copy metadata in lua script

Community Beginner ,
Jan 15, 2025 Jan 15, 2025

Copy link to clipboard

Copied

I'm trying to write a lightroom classic plugin. One of the steps is to copy metadata from one photo to another.

I'm using :

newPhoto:setRawMetadata("keywords", oldPhoto:getRawMetadata("keywords"))

but it throws the error.

Also "title" is an unrecognized metadata key even though it apears in the sdk docs.

TOPICS
SDK

Views

106

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 ,
Jan 15, 2025 Jan 15, 2025

Copy link to clipboard

Copied

"but it throws the error."

 

What's the error?

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
Community Beginner ,
Jan 15, 2025 Jan 15, 2025

Copy link to clipboard

Copied

It's in the title a assert failed packed

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
LEGEND ,
Jan 15, 2025 Jan 15, 2025

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

According to the API docs, photo:setRawMetadata() doesn't support the key "keywords":

 

johnrellis_0-1736983230785.png

 

Instead, use photo:addKeyword() and removeKeyword().

 

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
LEGEND ,
Jan 15, 2025 Jan 15, 2025

Copy link to clipboard

Copied

[This post contains formatting and embedded images that don't appear in email. View the post in your Web browser.]

 

""title" is an unrecognized metadata key even though it apears in the sdk docs."

 

Use photo:getFormattedMetadata() rather than getRawMetadata():

 

johnrellis_0-1736985451776.png

 

johnrellis_2-1736985550122.png

 

 

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
Community Beginner ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

There is no setFormattedMetadata, how do I set title? I couldn't just move the photos so I'm copying, reimporting and copying metadata. Title is one of the important fields for me.

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
LEGEND ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

Some fields you retrieve with getFormattedMetadata(), some with getRawMetadata(). But you set all fields using 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
Community Beginner ,
Jan 16, 2025 Jan 16, 2025

Copy link to clipboard

Copied

LATEST

Thank you for your help. I was able to finish my plugin. What is the software you're using in the screenshots you posted? It looks like it would be helpful.

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