Exif tool with powershell

Started by tb582, November 14, 2022, 01:47:00 PM

Previous topic - Next topic

tb582

I have a power-shell script that copies images from my cloud provider to my local machine; from there I need to add a line of metadata to each image and or video file (regardless of format) that specifies where its coming from ie 'mom', 'dad', 'self' etc which I know the rules for I just need to figure out what to use to set this metadata ...

StarGeek

The basic command would be simply

exiftool -TAG=VALUE /path/to/files/

The problem is figuring out which of the 6,635 writable tags, which can vary by file type, that you want to write.

Without more information, such as what programs will have to read this data, I would suggest using the Subject tag, which is used to hold keywords.  That can be written to both images and videos.

exiftool -Subject='Granny Weatherwax' -Subject='Granny Glenda' /path/to/files/

Note that this command will overwrite any previous values in the Subject tag.  If you wish to add values, use += instead of =.  Also see FAQ #17 and Note #1 under the -TAG[+-^]=[VALUE] option.

This command creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  Add -r to recurse into subdirectories.
* 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).

tb582

Thanks - this has seemed to work, in that the Exif data for subject is updated as expected.

My hope was that Google photos could use this metadata so I could bucket all the images under subject 'mom' for example into a shared folder BUT it doesn't seem to play nicely with this bit of metadata...

Any suggestions?

StarGeek

It has been a long time since I've tested anything on Google photos.  Is this "bucket" thing something new?  I don't see anything like that when I check.

I just uploaded my test image which has over 1,000 tags embedded in it and it doesn't look like Google photos has changed since last I checked.  It has the date (usually the DateTimeOriginal tag), several photo related data (Model, FocalLength, ISO, etc), the "Other" listing which is copied from the file's Description tag.  The Description used to fill out "Description" on the page but they changed that some months back.  Totally logical, right /s  And finally, if there are GPS coordinates, it will show the map location and give the city and country for that location, but it won't display the actual coordinates.

That's all the data I can see that Google will read.  You can't force it to read anything else.
* 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).