Author Topic: Add persons shown in keywords  (Read 7178 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: 25025
    • 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: 25025
    • 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

Offline bwana

  • Newcomer
  • *
  • Posts: 39
    • View Profile
Re: Add persons shown in keywords
« Reply #5 on: February 14, 2022, 09:46:36 AM »
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.
Hi - would you mind going into this process with more detail? I get sent a template and would like to use the Persons Shown ({prsn}) to help insert the player's name into the middle of the Description/Caption filed. For example:

SOMEPLACE, SOMEWHERE - FEBRUARY 14: {prsn} during the such and such event at that place on February 14, 2022 in Someplace, Somewhere. (Photocredit etc)

Do I then need to create a second template based off the first containing only the Caption with the {prsn} tag?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25025
    • View Profile
    • Camera Bits, Inc.
Re: Add persons shown in keywords
« Reply #6 on: February 14, 2022, 10:19:23 AM »
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.
Hi - would you mind going into this process with more detail? I get sent a template and would like to use the Persons Shown ({prsn}) to help insert the player's name into the middle of the Description/Caption filed. For example:

SOMEPLACE, SOMEWHERE - FEBRUARY 14: {prsn} during the such and such event at that place on February 14, 2022 in Someplace, Somewhere. (Photocredit etc)

Do I then need to create a second template based off the first containing only the Caption with the {prsn} tag?

First you would go through all of your images with the Metadata (IPTC) Info dialog and add the persons in each image to the Persons Shown field.  Once you're done with that, then you would apply your Metadata (IPTC) Template with the {prsn} variable in the Caption field.  Be sure to clear the "Apply checkbox" on the Persons Shown field, or you will be overwriting the Persons Shown field with whatever is currently in the Persons Shown field, which if blank will erase all of the work that you've done.

-Kirk

Offline bwana

  • Newcomer
  • *
  • Posts: 39
    • View Profile
Re: Add persons shown in keywords
« Reply #7 on: February 14, 2022, 11:54:05 AM »
First you would go through all of your images with the Metadata (IPTC) Info dialog and add the persons in each image to the Persons Shown field.  Once you're done with that, then you would apply your Metadata (IPTC) Template with the {prsn} variable in the Caption field.  Be sure to clear the "Apply checkbox" on the Persons Shown field, or you will be overwriting the Persons Shown field with whatever is currently in the Persons Shown field, which if blank will erase all of the work that you've done.

-Kirk
Thanks for the feedback Kirk - I suppose I was hoping for a more elegant solution that might save me time.

I don't suppose there is a means to define a cursor insertion point in the Caption field, so I could just start typing without having to relocate the cursor?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25025
    • View Profile
    • Camera Bits, Inc.
Re: Add persons shown in keywords
« Reply #8 on: February 14, 2022, 12:55:32 PM »
First you would go through all of your images with the Metadata (IPTC) Info dialog and add the persons in each image to the Persons Shown field.  Once you're done with that, then you would apply your Metadata (IPTC) Template with the {prsn} variable in the Caption field.  Be sure to clear the "Apply checkbox" on the Persons Shown field, or you will be overwriting the Persons Shown field with whatever is currently in the Persons Shown field, which if blank will erase all of the work that you've done.

Thanks for the feedback Kirk - I suppose I was hoping for a more elegant solution that might save me time.

What part is causing you to spend more time?  The application of the template should do the work for you and be done in a few minutes (depending on how many images are selected and how fast the disk is that the images are stored.)  The time being spent to enter the persons is a given for all methods of getting them into the caption.

I don't suppose there is a means to define a cursor insertion point in the Caption field, so I could just start typing without having to relocate the cursor?

No, no such feature exists.

-Kirk