Using ExifTool to Tag Camera Date and Time from Filename

Started by Blewyn, July 28, 2011, 02:07:06 AM

Previous topic - Next topic

Blewyn

I'm planning to use ExifTool to re-tag all 8267 of my family photos from the filename (example "2011-02-03 @ 15-43-32 My dog in the garden.jpg").

I did a small trial run with a few photos and tagged them with "-AllDates 2001", ie the year only, just to see if it would work.  It did set "camera date" to the correct value (when viewed in Photoshop 9 File information) but Picasa still reports the previous date.

Is there any way to set ALL dates - including file creation etc - to the desired value ?

Phil Harvey

First, you'll have better luck if you use a full date/time specification (yyyy:mm:dd hh:mm:ss).

Second, the AllDates tag is a shortcut for DateTimeOriginal, CreateDate and ModifyDate.  If there are other date/time tags you want to set you can add them to the command line.  Use "exiftool -time:all FILE" to see all time-related tags.

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

Alan Clifford

Phil, you still need the -a to see all with -time:all with Nikon D7000 nefs - the extra datetimeorginal that, I think, you told me about.

Alan

Phil Harvey

#3
Alan is correct that you won't see duplicates without -a, but it doesn't matter because you only need to assign the tag once when writing.  This will write all of the duplicate tags (unless you write a specific group, but we hadn't discussed this).

- Phil

Edit: I just thought of an exception, which maybe is what Alan was referring to:  ExifTool won't update duplicate values if they are stored in IFD1 or higher.  This is because these IFD's are used for separate images in TIFF files, and exiftool only modifies the main image metadata by default.  But we're getting technical here.
...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 ($).

Alan Clifford

Sorry to send the thread off on a tangent.  Too technical for me but it is ExifIFD datetimeoriginal that doesn't appear without the -a

alan@coprolith:nikon01-card-08$ exiftool -G1  -time:all AHC_2130.NEF
[System]        File Modification Date/Time     : 2011:07:18 16:16:58+01:00
[IFD0]          Modify Date                     : 2011:07:18 16:16:57
[ExifIFD]       Create Date                     : 2011:07:18 16:16:57
[Nikon]         Timezone                        : -04:00
[Nikon]         Daylight Savings                : No
[Nikon]         Date Display Format             : D/M/Y
[Nikon]         Power Up Time                   : 2011:07:18 15:01:10
[ExifIFD]       Sub Sec Time                    : 40
[ExifIFD]       Sub Sec Time Original           : 40
[ExifIFD]       Sub Sec Time Digitized          : 40
[IFD0]          Date/Time Original              : 2011:07:18 16:16:57
[Composite]     Create Date                     : 2011:07:18 16:16:57.40
[Composite]     Date/Time Original              : 2011:07:18 16:16:57.40
[Composite]     Modify Date                     : 2011:07:18 16:16:57.40
alan@coprolith:nikon01-card-08$ exiftool -G1 -a  -time:all AHC_2130.NEF
[System]        File Modification Date/Time     : 2011:07:18 16:16:58+01:00
[IFD0]          Modify Date                     : 2011:07:18 16:16:57
[ExifIFD]       Date/Time Original              : 2011:07:18 16:16:57
[ExifIFD]       Create Date                     : 2011:07:18 16:16:57
[Nikon]         Timezone                        : -04:00
[Nikon]         Daylight Savings                : No
[Nikon]         Date Display Format             : D/M/Y
[Nikon]         Power Up Time                   : 2011:07:18 15:01:10
[ExifIFD]       Sub Sec Time                    : 40
[ExifIFD]       Sub Sec Time Original           : 40
[ExifIFD]       Sub Sec Time Digitized          : 40
[IFD0]          Date/Time Original              : 2011:07:18 16:16:57
[Composite]     Create Date                     : 2011:07:18 16:16:57.40
[Composite]     Date/Time Original              : 2011:07:18 16:16:57.40
[Composite]     Modify Date                     : 2011:07:18 16:16:57.40
alan@coprolith:nikon01-card-08$


Phil Harvey

Hi Alan,

Interesting.  I had forgotten this.  Software that writes information in the wrong location is a constant pain in the side for me and other metadata users.  In this case, the EXIF specification states that DateTimeOriginal should be stored in the ExifIFD.  But you are correct that the IFD0 version will be displayed by default because it exists in the IFD of the main image (ExifTool prioritizes tags stored in this IFD).

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