peculiar question: rewriting dates based on folder names for a variety of media

Started by joesalamante, February 13, 2023, 10:19:47 AM

Previous topic - Next topic

joesalamante

Hi, I have read the manual 30 times and spent 3 days to get there.
I have 187 folders containing 16493 files of many kinds: jpg, but also 3gp, mts, etc.

I do understand this might only work for the support jpegs, it's FINE

So, with the tool correctly installed on windows and accessible from anywhere via CMD, I created this command:

exiftool -recurse -overwrite_original "-AllDates<${Directory;m/(\d{4}-\d\d-\d\d)/;$_=$1} 00:00:00"  *
If I'm not mistaken, this SHOULD overwrite ALL dates on the exif to the directory containing the files, with my structure being:

-Test
--2002-03-29
--2003-02-03
... etc, ad nauseum

The command DOES run, it DOES complete and says '13282 files updated'

PROBLEM: the exif data IS modified (date taken is now correct, happy days), BUT NOT the actual file modified/created. This is a problem for apps that rely on this for dating  a photo (ignore the exif)

Can exiftool be used to also modify such data? Thank you.

StarGeek

Quote from: joesalamante on February 13, 2023, 10:19:47 AMIf I'm not mistaken, this SHOULD overwrite ALL dates on the exif to the directory containing the files

No, AllDates is a Shortcut tag which consists of only three tags, DateTimeOriginal, CreateDate, and ModifyDate. These are the names of the three most commonly used date/time tags in the EXIF group, but there are matching tags in other groups.  For example, in MP4/Mov files, EXIF is non-standard so you can't create EXIF tags, but there is Quicktime:CreateDate, Quicktime:ModifyDate, and Quicktime:DateTimeOriginal and using AllDates will set those tags.

QuotePROBLEM: the exif data IS modified (date taken is now correct, happy days), BUT NOT the actual file modified/created. This is a problem for apps that rely on this for dating  a photo (ignore the exif)

This sounds like FAQ #3.  Use that command to find the names of the other tags you want to change.  I'm guessing that the tags you want are the file system ones, FileCreateDate/FileModifyDate.  To change those, you would duplicate the tag copy part of your command for each of these, changing AllDates into the file system tag.
* 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).