How to set createdate tag using filename as source of date

Started by fkatzen, December 26, 2010, 07:44:32 PM

Previous topic - Next topic

fkatzen

My pictures don't have EXIF tags but the camera saved the files using filenames with the following format: mtdyyrhrmn.jpg. For example the file 0121071045.jpb was created jan 21 2007 at 10:45 am.
Can anyone provide command that allows writing the create date tag using filenames with the format above?
Thanks

Phil Harvey

This will require a specialized user-defined tag.  I can provide you with a configuration file to do this later in the day.

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

Phil Harvey

#2
Here is a thread that describes the basic technique, and gives a config file which is close to what you need.  The only change you need to make is to use a value conversion something like this:

    ValueConv => q{
        return undef unless $val =~ /(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/;
        return(($3 lt '70' ? '20' : '19') . "$3:$1:$2 $4:$5:00");
    },


And a command like this:

exiftool "-createdate<mydatetime" FILE

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