Modify a portion of tag ?

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

Previous topic - Next topic

Archive

[Originally posted by davidbosse on 2007-12-10 05:41:33-08]

Hi,

I would like to know if it's possible to modify a portion of a tag.
Actually, I'd like to set the date of FileModifyDate and AllDates without modifying the time.

Thank you

David

Archive

[Originally posted by exiftool on 2007-12-10 12:24:18-08]

To do this would require a user-defined tag to extract the time from
a date/time value.  You could then set the date like this:

Code:
exiftool -alldates<"2007:03:04 $mytime" FILE

(Note: use single quotes in Unix, double as above in Windows)

The following config file will allow you to do this:

Code:
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyTime => {
            Require => 'DateTimeOriginal',
            # remove the date
            ValueConv => '$val=~s/.*? //; $val',
        },
    },
);
1;  #end

See the config
file documentation
for instructions on installing the configuration file.

- Phil