Metadata Template to use filename to change XMP Date Created

Started by DDBenson, November 21, 2014, 10:35:03 PM

Previous topic - Next topic

DDBenson

There was a Script in IM3 (a modified version of WriteFilmDataToEXIF written by Fred Wobus I believe?) which used the first eight characters of the filename to change the file's XMP Date Created value. This assumed a file naming convention whereby first eight characters were numbers representing the date the original image was recorded, and was used to appropriately set the creation dates on files created by scanning old slides or documents. For example, the script run on a file named "19551225_scan_12345.jpg" changed the XMP Date Created field to 12/25/1955 12:00:00 AM.

I've been trying to create a Metadata Template that accomplishes this same thing. I've figured out how to extract the first eight characters from the file name [variable {File.Name|substr:0,8}], but that's as far as I can go. Has anyone done this already? Will this instead have to be done via a script (and if so, has anyone created one yet)? Any ideas on how this could be done would be greatly appreciated. Thanks.


DDBenson

I think I'm making headway on this. The attached screen shot shows a Metadata Template that I believe should produce the results I want. Unfortunately it does not. After running it and then using the Metadata Browser to view the file, I can see that the Created Date field under the XMP xmp section, and the Date/Time Original field under the XMP exif section have been properly changed and formatted. But the Date/Time Original field under the Exif section and Date/Time Original field under the Composite section remain unchanged. The one under the Exif section is the one (I believe) that needs to get changed in order for the file to sort properly in the Timeline. I've tried using the Exif::Main\CreateDate and Exif::\DateTime Original tags, which caution you against doing so, but still no change occurs to the desired fields. I think I've tried every other date related tag but none seem to be the right choice.
Which tag should I be using to change the actual exif date?

[attachment deleted by admin]

Mario

When you update XMP data, IMatch changes the data in the database. Only when you write-back, IMatch propagates changes made to XMP also to EXIF,IPTC,GPS and other metadata. Did you write-back the file after applying your template?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DDBenson

Quote... Did you write-back the file after applying your template?

Yes.

hluxem

I had an issue with the time stamps before too. I modified the script from Fred to write time stamps to movie files and scanned images, I got it to work in earlier beta versions, but a lot has changed with the taqs and currently the script will not run.
A lot of the problems are caused by certain fields requiring a strict syntax. The exif fields require a full date with time. The time zone maybe required too. I did a short test with an avi file with empty date fields. Just changing the xmp fields with year-month- day worked fine and the file was moved on the timeline accordingly.
That will not work with pictures because the exif time stamp is considered first for the time line.
Try formatting your time stamp for the exif field with time (yyyy:mm:dd hh:mm:ss) by adding 00:00:00 to your template and see if that will update the exif field.

DDBenson

Quote from: hluxem on November 22, 2014, 03:55:31 PM
Try formatting your time stamp for the exif field with time (yyyy:mm:dd hh:mm:ss) by adding 00:00:00 to your template and see if that will update the exif field.

Brilliant! That seems to have done it. Thanks very much, hluxem.