News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

No Longer Able To Change File Dates

Started by shacho, February 13, 2011, 11:06:05 AM

Previous topic - Next topic

shacho

I often process photos from cellphones or other devices with cameras built in - devices where the EXIF implementation is always a big question.  I wrote this script to fix one such problem and synchronize the file dates with the shutter time stamp.  I'm pretty sure it used to work.  But now something seems to have changed.  Here's the script:

#!/bin/bash
exiftool -r -F -overwrite_original '-alldates<$datetimeoriginal' "$@"

The batch runs with no errors, but the File Creation and File Modified dates become the precise moment at which the script completes - not the datetimeoriginal date.  Is there a flaw in my command or is the OS doing this after the fact as it notices the changes?  Running Mac OS 10.6.6.

Shacho

Phil Harvey

Hi Shacho,

Your command writes the 3 common metadata date/time tags.  When writing, the filesystem creation and modification dates will be set to the current time.  You can use -P to preserve the filesystem modification date, or write FileModifyDate to set it to whatever you want.  ExifTool can not be used to set the filesystem creation date.

- 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 ($).

shacho

Phil - Thanks for the reply.  You're right - I was confusing the tags with the file system metadata.  I recently trashed all my settings in Adobe Bridge and started clean, and some tags had disappeared from the viewer.  On a related note, I can't seem to find any documentation that maps exif tag names to their monikers in Bridge.  For example "File Modification Date/Time" in exiftool output is "ModifyDate" in exiftool input is "Date Time" in Bridge.  Do you know of any documentation that provides these mappings.  I can't seem to find any.

Phil Harvey

I don't get into details about what tags are displayed by other software and what they are called.  Your best bet is to start with a clean file and use Bridge to write the metadata, then use exiftool to see where it went (this is FAQ 3).

- 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 ($).

shacho

Thanks Phil!  It's been a couple years since I read the manual and FAQs - looks like I'm due for a refresher.  Thanks again for your help.  Exiftool is an indispensable tool and we all appreciate your work.

Cheers,

Shacho