Use directory names to tag photos?

Started by octoturt, August 27, 2020, 04:49:44 AM

Previous topic - Next topic

octoturt

I have a bunch of photo/video files sorted into directories like so:
Photos/YYYY/MM/DD/
However, not all of the files are correctly tagged or named. How can I use exiftool to quickly update the tags and names of all the images?

Thank you!

StarGeek

You aren't giving much information.  Update in what way?  Rename in what way?  Are there any other numbers in the directory path other than the Year/Month/Date?
* 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).

octoturt

All I want to do is use the directory structure to change the date created tags for my photos.

octoturt

Sorry, let me be more concise...
Quote from: StarGeek on August 27, 2020, 11:12:11 AM
Update in what way? 
Modify the date created tags to contain the date, based on their location in the directory.
Quote from: StarGeek on August 27, 2020, 11:12:11 AM
Rename in what way?
Use the date in the name, I guess? I'm not really sure myself, this isn't a necessity for me
Quote from: StarGeek on August 27, 2020, 11:12:11 AM
Are there any other numbers in the directory path other than the Year/Month/Date?
No, it's just YYYY/MM/DD, for example, a photo taken today is located at Photos/2020/08/27

Sorry if I'm not providing enough information. I'm on macOS 10.15 Catalina.

Phil Harvey

To set CreateDate from the directory, you could do this:

exiftool "-createdate<directory 00:00:00" -r DIR

This will take the YYYY/MM/DD from the directory name and set the times to 00:00:00.

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

Luuk2005

Greetings.
Im think LampCo not settle files like C:/PhotosYYYY-MM-DD/image.jpg but instead settles them like C:/Photos/YYYY/MM/DD/image.jpg because Im much satisfied with this arrangement also! But Im not understand how to change filename because there is no examples, so Im think maybe to only change CreateDate??
exiftool "-CreateDate<${FilePath;s/.*\/(\d+)\/(\d\d)\/(\d\d)\/[^\/]*/$1:$2:$3 00:00:00/}" -ext jpg -r DIR

If also to change the filename, please give example for original filename and final name, so the experts can give good advice. Im think sometimes it needed for us noobs to help explain ourselves, yes?
Windows8.1-64bit, exiftool-v12.11(standalone), sed-v4.0.7