photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: hoppfrosch on March 08, 2020, 07:42:20 PM

Title: Change digit-date from filename?
Post by: hoppfrosch on March 08, 2020, 07:42:20 PM
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
Title: Re: Change digit-date from filename?
Post by: Mario on March 08, 2020, 08:31:36 PM
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 (https://www.photools.com/help/imatch/#tech_exifdate.htm?dl=h-2)

You can use the Time Wiz (https://www.photools.com/help/imatch/#app-time-wiz.htm) 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.
Title: Re: Change digit-date from filename?
Post by: Tveloso on March 09, 2020, 02:03:47 PM
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...
Title: Re: Change digit-date from filename?
Post by: Mario on March 09, 2020, 02:33:09 PM
Good tip. Thanks for sharing.
Title: Re: Change digit-date from filename?
Post by: ubacher on March 09, 2020, 03:59:35 PM
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.
Title: Re: Change digit-date from filename?
Post by: hoppfrosch on March 09, 2020, 06:20:02 PM
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  ::)
Title: Re: Change digit-date from filename?
Post by: Mario on March 09, 2020, 06:23:56 PM
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.
Title: Re: Change digit-date from filename?
Post by: jch2103 on May 26, 2020, 01:52:58 AM
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.
Title: Re: Change digit-date from filename?
Post by: jch2103 on May 26, 2020, 03:00:48 AM
Here's the jpg that I referenced above.
Title: Re: Change digit-date from filename?
Post by: jch2103 on May 26, 2020, 05:23:48 AM
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.