Modify tag value before using?

Started by matt, October 08, 2014, 09:13:07 PM

Previous topic - Next topic

matt

Hi....   Suppose I need to rename MTS files and change their filesystem modify timestamp based on their DateTimeOriginal tag plus 1 hour, without actually writing the DateTimeOriginal tag (which is not writable).   Is there a simple command-line way to do something like:


# my pseudo code:
exiftool  "-filename<${DateTimeOriginal+1}"   "-filemodifydate<${DateTimeOriginal+1}"   blah.mts


Or do I need to use a config file (like the guy a few months ago who wanted to compute the ages of his kids)?

I know it can be done in perl using Image::ExifTool but a command-line method would be cleaner.

Thanks!

Phil Harvey

Doing date/time adjustments is possible, but if you then want the time formatted it could be tricky.  But a 3-step process would do it:

exiftool "-filemodifydate<datetimeoriginal" -execute -filemodifydate+=1 -execute "-filename<filemodifydate" -d SOME_DATE_FORMAT -common_args blah.mts

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

matt

#2
Thank you very much... it worked perfectly!  Moreover, your command line was very educational --- it taught me a few things about exiftool's abilities and syntax.

Thanks again!

-Matt

Edit:  BTW, I actually ended up not needing to increment DateTimeOriginal by an hour after all, since it seems writing to FileModifyDate does a conversion to local time, whereas writing to FileName does not, and the combination of these two behaviors worked in my favor in this case (since my problem was simply the wrong TZ set in the files).