Author Topic: Add persons shown in keywords  (Read 1279 times)

Offline EM Dash

  • Newcomer
  • *
  • Posts: 3
    • View Profile
Add persons shown in keywords
« on: March 12, 2021, 09:21:33 AM »
I may be making this more complicated than I should, but I'm trying to add the persons shown field also to keywords. For example, for each image, I add the /name/ /player number/. I'd like that info to be added to keywords. I tried adding the {persons} variable in the Metadata IPTC Template, but when I go to the images' info that variable is deleted. Once I add in the persons shown info for the individual image, I can then add the variable back in keywords, but that's time consuming. Is there something I'm doing incorrect?

On another note, I have my replacement code as such Column 1 - code, Column 2 - player name, Column 3 - player #, Column 4 - player position, Column 5 - team. Is there an easier way to add the # or position automatically to the persons shown field in the Metadata IPTC Template by appending - and also in keywords without having to do individual code for each person? The reason I'd like to avoid doing one code entry with name, #, position in the persons shown field specifically is that many times, I rename the image to the persons shown (i.e., name) and want to avoid # and position also added to the filename. I'm not sure if this all makes sense.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 23409
    • View Profile
    • Camera Bits, Inc.
Re: Add persons shown in keywords
« Reply #1 on: March 12, 2021, 11:11:31 AM »
I may be making this more complicated than I should, but I'm trying to add the persons shown field also to keywords. For example, for each image, I add the /name/ /player number/. I'd like that info to be added to keywords. I tried adding the {persons} variable in the Metadata IPTC Template, but when I go to the images' info that variable is deleted. Once I add in the persons shown info for the individual image, I can then add the variable back in keywords, but that's time consuming. Is there something I'm doing incorrect?

Variables cannot remain as variables in the metadata of images.  When you apply the template the variable is evaluated.  If it evaluates to some text then that text will replace the variable.  If that variable evaluates to nothing, the variable is removed (replaced with nothing.)

So instead of trying to get a variable to not evaluate and remain in your image's metadata for later evaluation, just do two passes with the Metadata Template, the first one applying the common data you have for all of your photos.  Then once you've filled in that persons shown data and you want it in your keywords, apply another Metadata Template using the {persons} variable in your keywords.  Your images should now have the persons listed in Persons Shown also in their Keywords field.

On another note, I have my replacement code as such Column 1 - code, Column 2 - player name, Column 3 - player #, Column 4 - player position, Column 5 - team. Is there an easier way to add the # or position automatically to the persons shown field in the Metadata IPTC Template by appending - and also in keywords without having to do individual code for each person? The reason I'd like to avoid doing one code entry with name, #, position in the persons shown field specifically is that many times, I rename the image to the persons shown (i.e., name) and want to avoid # and position also added to the filename. I'm not sure if this all makes sense.

If you do your renaming after the replacements occur, none of the code entries should be there.  Or maybe I'm misunderstanding what you're describing.

-Kirk

Offline EM Dash

  • Newcomer
  • *
  • Posts: 3
    • View Profile
Re: Add persons shown in keywords
« Reply #2 on: March 12, 2021, 11:49:41 AM »

Variables cannot remain as variables in the metadata of images.  When you apply the template the variable is evaluated.  If it evaluates to some text then that text will replace the variable.  If that variable evaluates to nothing, the variable is removed (replaced with nothing.)

So instead of trying to get a variable to not evaluate and remain in your image's metadata for later evaluation, just do two passes with the Metadata Template, the first one applying the common data you have for all of your photos.  Then once you've filled in that persons shown data and you want it in your keywords, apply another Metadata Template using the {persons} variable in your keywords.  Your images should now have the persons listed in Persons Shown also in their Keywords field.

Ok, so I attempted this method....Input persons shown info in each image. Then I tried two ways to replace Metadata IPTC template: 1) Right click > Apply Metadata Template and 2) Save Selected Photos As and check the box "Apply Metadata (IPTC) Template. In both cases, the persons shown data was deleted completely from the EXIF data. In the template, I have Persons Shown checked and in keywords I have the variable {persons}. The persons shown field is obviously blank in the template. Maybe I'm misunderstanding your instructions.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 23409
    • View Profile
    • Camera Bits, Inc.
Re: Add persons shown in keywords
« Reply #3 on: March 12, 2021, 12:42:39 PM »

Variables cannot remain as variables in the metadata of images.  When you apply the template the variable is evaluated.  If it evaluates to some text then that text will replace the variable.  If that variable evaluates to nothing, the variable is removed (replaced with nothing.)

So instead of trying to get a variable to not evaluate and remain in your image's metadata for later evaluation, just do two passes with the Metadata Template, the first one applying the common data you have for all of your photos.  Then once you've filled in that persons shown data and you want it in your keywords, apply another Metadata Template using the {persons} variable in your keywords.  Your images should now have the persons listed in Persons Shown also in their Keywords field.

Ok, so I attempted this method....Input persons shown info in each image. Then I tried two ways to replace Metadata IPTC template: 1) Right click > Apply Metadata Template and 2) Save Selected Photos As and check the box "Apply Metadata (IPTC) Template. In both cases, the persons shown data was deleted completely from the EXIF data. In the template, I have Persons Shown checked and in keywords I have the variable {persons}. The persons shown field is obviously blank in the template. Maybe I'm misunderstanding your instructions.

If you set the checkbox on a field and the field is blank then this will clear the field.  You need to uncheck the Persons Shown field.  It does not need to be checked in order for the variable {persons} to be evaluated.

-Kirk

Offline EM Dash

  • Newcomer
  • *
  • Posts: 3
    • View Profile
Re: Add persons shown in keywords
« Reply #4 on: March 12, 2021, 12:46:40 PM »
Quote

If you set the checkbox on a field and the field is blank then this will clear the field.  You need to uncheck the Persons Shown field.  It does not need to be checked in order for the variable {persons} to be evaluated.


That solved it! Thank you