ExifTool Forum

ExifTool => Archives => Topic started by: Archive on May 12, 2010, 08:54:24 AM

Title: date.keyword manipulation
Post by: Archive on May 12, 2010, 08:54:24 AM
[Originally posted by ansta1 on 2008-09-03 19:51:08-07]

Hey,

just been shown this tool and wow it's so powerful. I've been looking for something like this. I've had a play and while I'm sure it can do what I need I'm sure that it's been done before so was wondering if you guys could help.

What I would like to do is take the impage capture time from the exif data, timeshift the time and then reformat if to hh:mm:ss and then write this value to the keywords field.

So as an example imagex.jpg has a capture time of 2007:11:10 10:30:00

I like to be able to take this date/time data and subtract 30 minutes and then write just the hh:mm:33 portion of the data to the keywords field. So I'd like to see 10:00:00 written to the keywords field.

Any suggestions? (ps go easy on me as I'm new to the tool).

Regards
Title: Re: date.keyword manipulation
Post by: Archive on May 12, 2010, 08:54:24 AM
[Originally posted by exiftool on 2008-09-04 10:50:01-07]

This can be done with a user-defined tag and the following
config file:

Code:
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        ShiftedTime => {
            Require => 'DateTimeOriginal',
            ValueConv => q{
                require 'Image/ExifTool/Shift.pl';
                Image::ExifTool::ShiftTime($val, '0:30', -1);
                $val =~ s/^\S+\s+//; # remove date
                return $val;
            },
        },
    },
);

using this command line:

Code:
exiftool "-caption-abstract<shiftedtime" FILE

See the config
file documentation
for help with installing the config file.

- Phil