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

Assert Failed Packed when trying to copy metadata in lua script

Community Beginner ,
Jan 15, 2025 Jan 15, 2025

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
241
Translate
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

"but it throws the error."

 

What's the error?

Translate
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
It's in the title a assert failed packed
Translate
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

[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().

 

Translate
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

[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

 

 

Translate
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

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.

Translate
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

Some fields you retrieve with getFormattedMetadata(), some with getRawMetadata(). But you set all fields using setRawMetadata().

Translate
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
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.

Translate
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