Add keyword for identical photos in different folders

Started by gilhin, November 29, 2022, 02:00:18 PM

Previous topic - Next topic

gilhin

Dear,

I have two directories with photos. One hold my complete library and the other contains the photos that I share with the family.
What I would love to do is to add a keyword (or any marking) to the files in the library folder so that I can

  • identify the "published" photos and
  • delete the second folder

The files have the same name and the same metadata in both folders.

Would that be a task for exiftool - and if so, how would it be achieved?

Thank you for pushing me in the right direction,
Gilhin

StarGeek

Unless I'm missing something, your command would be something like
exiftool -Subject+="Keyword 1" -Subject+="Keyword 2" /path/to/library/file.jpg /path/to/share/file.jpg

You can list multiple directories and/or files for any command and exiftool will write them all.

I used the += here for assigning the keywords so as not to overwrite any previously existing keywords.  See FAQ #17 for more details.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

gilhin

Thank you for your swift reply.
However - just to be sure that we are on the same page here.
The command that you issued would add the two keywords to the two named files, right?

I was rather thinking into a different direction. What I would like to achieve is to take the published set of photos as a "master set" and to add a keyword to the same photo in the library folder path.

Would that be the outcome of your proposal - or if not, would you have an idea on how to achieve this?

Best regards
Gilhin

Phil Harvey

Hi Gilhin,

Right.  That command would add 2 keywords to both files.

I'm not clear on exactly what you want to do either, but to add a keyword to all files in a folder, you would do this:

exiftool -subject+="some keyword" DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gilhin

Hi Phil,

thank you for sharing your thoughts.
What I would like to do is to to issue a command like

exiftool -somemagicoptions -subject+="2015" source:/path/to/published/2015/ dest:/path/to/library/
In my imagination, exiftool would check the destination folder (and it's subfolders) for photos that are identical to the source folder and add the keyword 2015 to the identified duplicates in the destination folder.

Hopefully, this clarifies my idea/ vision/ whatever you want to call it.

Best regards

Gilhin

Phil Harvey

Hi Gilhin,

When you say "photos that are identical to the source folder", I assume that you mean "have a name the same as in the source folder".  If so, then this is the command:

exiftool -subject+=2015 -ext jpg -srcfile /path/to/library/%f.%e /path/to/published/2015/

This will add the keyword "2015" to all JPG files in /path/to/library that have counterparts in /path/to/published/2015/ with the same name.

You will get an error for any file in the published directory that doesn't exist in the library, but you can ignore these.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

gilhin

Hi Phil,
thank you for your support.
Your suggestion worked like a charm.

Best regards,
Gilhin

Alan Clifford

This looks like an example of the xy problem, viz here is the solution, how do I implement it?

But given the actual problem, the solution is to make the entries in the family folder symbolic links into the original folder.