|Welcome to the Monastery|
(Solved) Change "Date Picture Taken" with Image::ExifToolby Limbic~Region (Chancellor)
|on Jul 25, 2008 at 00:49 UTC||Need Help??|
Limbic~Region has asked for the
wisdom of the Perl Monks concerning the following question:
Before returning home from vacation, I downloaded the pictures my sister had taken on to my laptop. I just realized her camera has the wrong date so the the meta data in all the pictures is wrong. Thanks to Khisanth, I am pretty sure the module I want to use is Image::ExifTool. I am also fairly certain that the tag I need to modify is one of the following: CreateDate ModifyDate DateTimeOriginal
What I can't figure out is how to use the SetNewValue() correctly such that the WriteInfo() doesn't fail. Does anyone have a complete working example? Admittedly, I have only been RTFMing in between commercials but what I have looks something like this (
Update: Added error I am getting.
Update 2: It appears to be a corrupt file (though it views fine) because the same code worked correctly on another picture. Does anyone know how to fix that?
Update 3: I noticed $exifTool->SetNewValue('*'); # delete all non-EXIF tags in TFM. I tried it, and what do you know, it fixed the problem. Of course, I didn't want to delete all the tags so then I restored the original. I then looped over all the tags, deleting each one in turn, and then trying the write. It turns out that 'Make' was the key though I still don't know why. The code above has been modified above to reflect the now working code.
Cheers - L~R