Change digit-date from filename?

Started by hoppfrosch, March 08, 2020, 07:42:20 PM

Previous topic - Next topic

hoppfrosch

Hi,

don't know exactly what I did, but I changed the digitialisation date of a few hundred photos to the current date and time by accident. :-\ :( ::)
This happened with new IMatch2020 - don't know whether it is connected with the new version or not ...

Now I have quite a few photos which do have the wrong date.

Fortunately I renamed the files to YYYYMMDD-HHMMSS.[ext] before the mistake happened.

Now I want to reset the date of the photos by data from filename.

Is there any way to do this?

Cheers
hoppfrosch

Mario

There is no feature in IMatch which changes date and time 'automatically'.

What people sometimes surprises is that when a file has no usable date and time information (no EXIF, no IPTC, no XMP, ...) IMatch falls back to using the "last modified" date and time provided by the file system. See How IMatch uses Date and Time Information

You can use the Time Wiz app if you need to set the date and time of your files from the file name.
The TimeWiz allows you to fill the date and time from a variable.
But make sure you are using the correct format, which is explained in the TimeWiz.

The format must be standard ISO / ExifTool format: YYYY:MM:DD hh:mm:ss so you will need to re-format your file names accordingly.
Use substr to extract the individual parts of the date and time and re-format them into the required format.

{File.Name|substr:0,4}:{File.Name|substr:4,2}:{File.Name|substr:6,2} {File.Name|substr:9,2}:{File.Name|substr:11,2}:{File.Name|substr:13,2}

should produce the correct format YYYY:MM:DD HH:MM:SS from your file name.

Check in the VarToy app to be sure.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Tveloso

hoppfrosch, although you already have a solution to your date issue, I also wanted to point out another IMatch feature that will be of great help in this area.

I too have a block of files that lack any usable date, so IMatch must fall back to using the FileSystem dates.  Now that I've been working in IMatch2020, some of these files have been "popping up" to the top of File Windows that are sorted descending by capture time.

I already knew about these files thanks to a two Data Driven Categories discussed here:

https://www.photools.com/community/index.php?topic=8742.msg61554#msg61554

It might beneficial for you to create those categories, in case you have files without dates that don't adhere to your naming convention...
--Tony

Mario

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ubacher

You can also use a metadata template to fill XMP::xmp\CreateDate using the formula Mario has given.
({File.Name|substr:0,4}:{File.Name|substr:4,2}:{File.Name|substr:6,2} {File.Name|substr:9,2}:{File.Name|substr:11,2}:{File.Name|substr:13,2})

I do this for video files which have stored UTC time in the metadata but the correct time in the name.

hoppfrosch

Thanks a lot for your support - I will also follow your tips. :thumbsup:

I am still unsettled what makes this happen ... its the first time this happened in more the 10years of messing around with thousands of photos  ::)

Mario

Unless you manually delete the data and time in the metadata panel, the most plausible explanation would be that the files have no usable date and time. Easy to check in the ExifTool Command Processor.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

jch2103

I need to revive this thread: I've run into a similar problem, but trying the above fix with a metadata template like the one above hasn't worked.

Background:
These jpg images had xmp sidecar files for reasons I don't recall; I thought I'd previously deleted all such xmp sidecars, but apparently not these. Interestingly, the xmp sidecar files had the correct date/times. The images themselves have somehow been assigned date/times of 1962:07:01 (? perhaps from assigning date/times to scanned images, but no idea why these digital camera images were changed.) Fortunately, the files had the original date/times in the file names. This should have made it easy to change the image date/times with a metadata template. Not so.

When trying to change the image date/times with the TimeWiz app, I got the attached message. I then ran the Metadata Analyst app on one the same image (one of 15) and got the attached report. Correct date/time: 2003:04:40 14:07:28 Incorrect date/time: 1962:07:01 12:00:00

My metadata template is shown in the attached screenshot.

I also tried changing the date/times using a metadata layout (the Default layout). The correct date/times show up there, but other metadata tags persist in holding erroneous data. At this point I'm not sure how to 'unstick' the wrong date/times.
John

jch2103

Here's the jpg that I referenced above.
John

jch2103

PLEASE DISREGARD MY TWO ABOVE POSTS: Operator error! I had an error in my formula for using the file name to populate date/times. (I wasn't able to delete the posts; apparently I waited too long to delete...)

My apologies; all is now well.
John