Whats App Date Change - I'm lost .....

Started by garden2, December 15, 2022, 02:19:38 PM

Previous topic - Next topic

garden2

Hi

Whilst I have a reasonable knowledge of computers, I am totally lost with how to use the ExifTool so I am hoping that someone will look kindly on a novice ...

I changed my Android phone recently and the Whats App back up has now put all the photos in my Gallery to the date I did the backup.

On my new phone, when I look at the individual photo, I can see the Original Date Taken, as well as Date Modified (but oddly when I connect it to my laptop and view the file in the Laptop Gallery there is no date info at all !!) Of course, the Whats App filename (eg IMG-20190914-WA0001.jpeg) also still has the correct date information.

Is there a simple way to get my photos back in the correct date order and if so would someone be prepared to help me, step by step, to do it ?

Many thanks

StarGeek

What's App strips away all metadata from its files, so whatever your phone is looking at, it's probably part of the phone's underlying file system.  Exiftool can copy the date from the filename into the file, but there won't be the necessary time component in the filename from what I've seen.

I haven't tried it, but you might try and zip the images up first.  A zip archive should contain the file system date/times.  You could then move the zip file to the desktop and then check the file system time stamps to see if they're correct.  You would run this command to see all the time related tags
exiftool -G1 -a -s -Time:All /path/to/files/

Hopefully, either the FileCreateDate or FileModifyDate will be correct.  From there, you would run this command, using either the create or modify date
exiftool "-AllDates<FileModifyDate" /path/to/files/

If you don't care about the time and the date alone is just fine, then you could use
exiftool "-AllDates<${Filename;m/(\d{8})/;$_=$1} 00:00:00" /path/to/files/

These commands creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  If this command is run under Unix/Mac/PowerShell, change the double quotes into single quotes to avoid interpreting the dollar sign as the start of a shell variable.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

garden2

Quote from: StarGeek on December 15, 2022, 03:19:06 PMIf you don't care about the time and the date alone is just fine, then you could use
exiftool "-AllDates<${Filename;m/(\d{8})/;$_=$1} 00:00:00" /path/to/files/

These commands creates backup files.  Add -Overwrite_Original to suppress the creation of backup files.  If this command is run under Unix/Mac/PowerShell, change the double quotes into single quotes to avoid interpreting the dollar sign as the start of a shell variable.

Hi, thanks for replying - much appreciated. I'm not bothered about time, just the date. Is there a simple guide which sets out the key steps in using the Exif Tool as I'm starting from a zero base ?

Thanks

StarGeek

Not really, as a lot of working with exiftool is knowing which of the 25,000+ tags you want to work with.  Read the docs and the FAQs and look at the examples.

FAQ #3 is especially important as it is the command that shows you all tags including duplicates and the groups they belong to.

If you have something specific you want to do, I can help create the command needed to do so.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

garden2

Thanks StarGeek– I think I am getting somewhere now but still not there yet ....

I have worked out how to run ExifTool and can now see all the metadata on some test photos

It confirms that the File Modification Date is the date I did the phone backup, 2020:03:11, whereas the WhatsApp filename is IMG-20160524-WA0001.jpg which is the date I actually took the photo (24/5/2016).

However there is also a Modify Date as well given as 2016:05:16, so there is still information in the metadata which shows the original date as well as the WhatsApp filename !!!

How do I now get the date changed to the actual date taken ? (I am only interested in the Date, not the Time). You suggested above:

exiftool "-AllDates<${Filename;m/(\d{8})/;$_=$1} 00:00:00" /path/to/files/    Is that still the correct code or given what I noted above are there any changes ?

Also I assume that /path/to/files/ is the location of the files but where do the 'new files' get sent to ?

I'm very grateful for your time and help

StarGeek

Quote from: garden2 on December 17, 2022, 05:04:13 PMIt confirms that the File Modification Date is the date I did the phone backup, 2020:03:11, whereas the WhatsApp filename is IMG-20160524-WA0001.jpg which is the date I actually took the photo (24/5/2016).

However there is also a Modify Date as well given as 2016:05:16, so there is still information in the metadata which shows the original date as well as the WhatsApp filename !!!

Make sure you use the command in FAQ #3.  It will give you the actual tag names, which never have spaces in them, as well as their locations.  FileModifyDate is the file system time stamp and ModifyDate would be an time stamp embedded in the file, most likely in the EXIF group.

Quoteexiftool "-AllDates<${Filename;m/(\d{8})/;$_=$1} 00:00:00" /path/to/files/
Is that still the correct code or given what I noted above are there any changes ?

Yes, as long as you're not worried about the time.  If you see a tag that has the correct time, you can copy that to the file if you wanted.  That command would be this, replacing TAG with the name of the tag you are copying from
exiftool "-AllDates<TAG" /path/to/files/

You might also want to copy to the file system dates.  If so, you would duplicate the quoted part in the above commands and replace AllDates with FileCreateDate/FileModifyDate For example
exiftool "-AllDates<TAG" "-FileCreateDate<TAG" "-FileModifyDate<TAG" /path/to/files/

QuoteAlso I assume that /path/to/files/ is the location of the files but where do the 'new files' get sent to ?

They are created in the same location as the original files.  Backup files will be created unless the option I listed above is used.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

garden2

#6
Nearly there but not quite !!!

As you kindly suggested I ran

...desktop\exiftool "-AllDates<${Filename;m/(\d{8})/;$_=$1} 00:00:00" c:\WAITest 

and and when I copied the test photos back to the Gallery they now appear in December 2022 and not the Phone Backup date, which is a really positive step but obviously isn't the Date Taken.

This is a sample output for a photo taken on 24/05/2016:

======== c:/WAITest/IMG-20160524-WA0000M.jpg
ExifTool Version Number        : 12.52
File Name                      : IMG-20160524-WA0000M.jpg
Directory                      : c:/WAITest
File Size                      : 45 kB
File Modification Date/Time    : 2022:12:19 11:10:44+00:00
File Access Date/Time          : 2022:12:19 11:10:53+00:00
File Creation Date/Time        : 2022:12:17 21:27:59+00:00
File Permissions                : -rw-rw-rw-
File Type                      : JPEG
File Type Extension            : jpg
MIME Type                      : image/jpeg
.....
Modify Date                    : 2016:05:24 00:00:00
Date/Time Original              : 2016:05:24 00:00:00
Create Date                    : 2016:05:24 00:00:00

Am I using the code correctly ?

Many thanks

StarGeek

Yep, that output shows the command worked correctly.  The problem is figuring out what your Gallery App is reading.  It looks like the app doesn't ready any of the embedded metadata, only the file system time stamps

Try
exiftool "-AllDates<${Filename;m/(\d{8})/;$_=$1} 00:00:00" "-FileModifyDate<${Filename;m/(\d{8})/;$_=$1} 00:00:00" "-FileCreateDate<${Filename;m/(\d{8})/;$_=$1} 00:00:00" c:\WAITest

Hopefully this will work.  If it doesn't, then the file system time stamps aren't being set on the copied file.  There's pretty much nothing that can be done with exiftool at that point.  You'll have to find a way to properly set them on the android.

You might also look for a better gallery app that will actually read the data in the file.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

garden2

Sorted - my test file put all the photos at the correct date in the Gallery app.

Really appreciate your help - many thanks

Next stop is the mp4's but one step at a time ......

StarGeek

Quote from: garden2 on December 19, 2022, 03:21:19 PMNext stop is the mp4's but one step at a time ......

MP4s may have more problems, as the embedded time stamps may not be properly read.

The main video tags, Quicktime:CreateDate and Quicktime:ModifyDate, as well as the track timestamps (4 tags for each stream), are supposed to be set to UTC.  Windows and Mac recognize this and will adjust the time stamp to local time under Properties/Finder.  But not all apps will read and adjust the time properly.

When writing these time stamps, you can add the -api QuickTimeUTC option and exiftool will automatically adjust the date/time you write from the local time to UTC when writing.  Or if the time of the file isn't the local time  zone, you would have to add the time zone to the written date/time and it will be adjusted.

Two other video tags that might be read are the Quicktime:DateTimeOriginal and Quicktime:CreationDate.  Apple apps will read these tags.  These are to be set to local time and a time zone is needed to make Apple apps happy as they screw up the time massively if the time zone isn't included.  Exiftool will automatically add the local time zone if it isn't part of the value written.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).