batch writing unique EXIF data to an entire folder of images in Windows

Started by smkohler, April 25, 2017, 04:49:47 PM

Previous topic - Next topic

smkohler

I am a new user of ExifTool and I have a simple use case for a large data set that I would love some tips on.  I am a Windows user and have a folder of about 10k JPG images labeled Image (1).jpg, Image (2).jpg, etc.  I would like to write some basic EXIF data to this images that is obtained from a text file.  For each image, the text file would have the file name and what specific EXIF data I want to write to it.  The specific data I want to write to each image is: date taken, gps coordinates, author and imagedescription.  Given I have about 10k images that I want to update and I already have the desired exif data for each image available in a text file (I can reformat it if needed), I am looking for tips on how to automate/batch updating all of the images.  Ideas?

StarGeek

I'd say that your best bet might be to reformat as a CSV file.  See -csv option and FAQ 26.  You would have to name the first column as SourceFile and each following column would be the name of the tags.

Some things to watch out for.  There is no such thing as a "Date Taken" tag.  That is a Windows property that is filled from various tags.  See this post for the data.  Odds are you want to use DateTimeOriginal at the very least, but AllDates is also a good option.  EXIF gps data doesn't accept negative numbers, so if either your Latitude or Longitude numbers are negative (West or South), you also need to set the GPSLatitudeRef and/or GPSLongitudeRef tags.  The easiest thing to do, especially if you're using Exel or Calc to format the CSV, is just duplicate the GPSLatitude and GPSLongitude columns and add Ref to the headers.  With Author, you may actually be looking for EXIF:Artist.  The other option is EXIF:XPAuthor which probably wouldn't be the best choice as most programs, such as LightRoom, don't use, instead using EXIF:ArtistImageDescription is fine as is.

Here's an example
SourceFile,ImageDescription,Artist,DateTimeOriginal,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef
c:\full\path\to\image.jpg,Image Description Text,smkohler,2017:04:25 14:58:43,33.8568° S,33.8568° S,151.2153° E,151.2153° E


edit: spelling
* 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).

smkohler

This was exactly what I needed!  Thanks so much for the very quick response and for the help.  I now have it working on my side with the specific fields I need and all is well.  Thanks again!