Creating EXIF tags from Filename

Started by Archive, May 12, 2010, 08:54:13 AM

Previous topic - Next topic

Archive

[Originally posted by pavink on 2007-12-18 08:50:19-08]

It seems that my long search is finally over: I need a utility that can read the date from a filename, and put that information in an EXIF tag. Concreet: I have files named like 19851231_blabla.tif, and want to put the '31 December 1985' information from the filename into the Created EXIF field.

I am a bit intimidated by ExifTool's scripting language, but noted a post in this forum that talks about this. However, it also mentions that an update of the software is needed due to some bug.

Can anybody provide some quick guidance on how to do this? And I indeed need to wait for a new software release?

Thank you very much - I have searched for months for a tool that can do this (have several thousand files that need to be processed this way ...)

PaVink

Archive

[Originally posted by exiftool on 2007-12-18 12:13:23-08]

I assume you are talking about
this thread.

Yes.  The date/time parsing was improved in exiftool 7.04 as mentioned.
The current version is 7.06.

- Phil

Archive

[Originally posted by pavink on 2007-12-18 22:06:16-08]

thanks, Phil!
I am struggling with the parameters, though...

What would the commandline be for putting the 'YYYYMMDD' in the EXIF information if the filename is like YYYYMMDD_SomeOtherText.tif?  

For instance, putting 25-DEC-2007 in the EXIF tag if the filename is 20071225_ChristmasParty.tif

(pavink)

Archive

[Originally posted by exiftool on 2007-12-19 00:38:03-08]

The command is:

Code:
exiftool "-createdate<filename" FILE

Where FILE is an image file with YYYY MM DD in the name.
(ie "20071225_ChristmasParty.tif".)
ExifTool will reformat the date according to
the EXIF standard (YYYY:MM:DD hh:mm:ss), and will assume
00:00:00 for the time since it didn't exist in the name.

- Phil

Archive

[Originally posted by pavink on 2007-12-19 07:11:26-08]

THAT SIMPLE ??! Thank you for making me look like an idiot in the forum ... :-)

No really - appreciate you kind help!
FYI - It failed at first since I often have 00 in the DD field (since I do not know the exact date), and then ExifTool puts todays date in EXIF. But by changing all the 00 to 01 it works flawlessly ...

Again - thank you very much. Wish you great holidays!

pavink

Archive

[Originally posted by exiftool on 2007-12-19 12:20:01-08]

I'm glad you got it working, but I'm confused about the day problem
since exiftool doesn't check the range of values.  Here is a test I
just ran:

Code:
> exiftool -datetimeoriginal 20070000_Christmas.jpg
Date/Time Original              : 1985:12:31 00:00:00
> exiftool "-datetimeoriginal<filename" 20070000_Christmas.jpg
    1 image files updated
> exiftool -datetimeoriginal 20070000_Christmas.jpg
Date/Time Original              : 2007:00:00 00:00:00

- Phil