ExifTool Forum

ExifTool => Newbies => Topic started by: Cliffster on April 12, 2023, 12:08:10 PM

Title: Parsing folder path and adding to EXIF tags
Post by: Cliffster on April 12, 2023, 12:08:10 PM
Our nonprofit has about 20,000 photos taken over 25 years in as many countries.

The photos are stored in a folder tree that has a sub-folder for every country and, under these, sub-folders for cities, universities, and hospitals (some of the folder names indicating which year the photos were taken, like...

Photos/Nigeria/Abuja2008

or

Photos/PapauNewGuinea/EducationDepartment

Many of the older photos lack GPS info, so I'd like, as much as possible, to retain the folder names as keywords in as we move the images into a database.

Any advice on how to accomplish this?
Title: Re: Parsing folder path and adding to EXIF tags
Post by: Phil Harvey on April 12, 2023, 12:33:51 PM
You could use a command like this:

exiftool "-subject<directory" -sep "/" -r Photos

This will also add "Photos" as a keyword, and it will preserve "_original" backup files.

- Phil