Google takeout to OneDrive metadata issues

Started by Mat, April 29, 2023, 06:36:36 AM

Previous topic - Next topic

Mat

Hi everyone,

First of all, thank you for this amazing software tool! This is a real gem I never heard of before. Thank you to the developers who made this tool and the active team on the forum.

I have used google takeout to transfer about 40 GB of jpg, png, mov, heic, and mp4 to OneDrive. The first issue I encountered was that the metadata was lost. So after some research, I found out about ExifTool and used the following command lines to fix the issue.

exiftool -s "[DirectoryName]\[filename].[extension]exiftool -s "[DirectoryName]\[filename].[extension].jsonexiftool -r -d %s -tagsfromfile "%d/%F.json" "-FileCreateDate<PhotoTakenTimeTimestamp" -ext "*" -overwrite_original -progress --ext json "[DirectoryName]
This worked for every file type except mp4 files. After some more research on this forum, I saw that changing the mp4 metadata is hard. With the fact that mp4 data is only for Live Photos is don't really care about those.

But what I do care about is that in my folder every file has the original date in the metadata. So I download these files in the picture map on OneDrive with the expectation it is fixed and every phot and video is placed on in the correct timeline. But for 20% it isn't. This is really strange to me because on my laptop it is correct but on OneDrive it isn't.

I have a feeling that most of the photos that are not correctly placed in the timeline of OneDrive are pictures that I downloaded through social media like whatsapp or instagram or snapchat. I don't know if this has anything to do with it.

Also, I see that for the pictures and video's that are not correctly placed on the timeline the timestamp created is missing in OneDrive Metadata on OneDrive.pdf , but the metadata is there before I uploaded it to OneDrive Metadata before upload to OneDrive.pdf see the pictures. With the pictures that are correctly placed on the timeline of OneDrive they have an extra metadata tag "Date created" Metadata corretly on OneDrive.pdf.

I saw in another forum that someone pointed out that it might be a good idea to change every date tag to the original date the photo or video was taken. Maybe you force OneDrive this way. But again I don't know if this would work and how to do it.

So my question is how can I make the last 20% of my photos and videos correctly in the timeline of OneDrive?

This would mean a lot to me.

Thank you very much for reading.

Mat


StarGeek

Quote from: Mat on April 29, 2023, 06:36:36 AMThe first issue I encountered was that the metadata was lost.

The embedded metadata was not lost.  Google does not remove or edit any of the embedded metadata. The only thing that was lost was the file system based data, such as the file system time stamps, xattr/MDItem data on a Mac, and Alternate Data Streams on Windows.

If you made edits on the Google website, then that data will appear in the json files.  But for any other data, copying from the json files means you're overwriting the original data.  In the case of the date/time tags, you will be writing the incorrect data as the json timestamps are in UTC while image timestamps are supposed to be local time.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Mat

Thank you for the quick response. So I shouldn't have used the JSON file to overwrite the date/time tags? Because before I didn't change anything and every photo had the same day.

Now with the above solution, 20% of my photos are still wrong. What can I do about those? If you need more information please let me know.

Thank you

StarGeek

You don't mention what you're using to see the day, but I'm guessing you're looking at the "Date" in the directory listing or something similar, which is probably the file system's FileModifyDate.

Under Windows, right click a black area in the header and select the "Date Taken" property


The will allow you to sort by the actual time stamps of the images.  Videos use a different property called "Media Created"

To copy from the embedded tags into the file system tags, you could use a command like this.
exiftool -api QuickTimeUTC "-FileModifyDate<CreateDate" "-FileModifyDate<DateTimeOriginal" /path/to/files/

This will copy the most commonly used embedded time stamps to the file system one.  The addition of the -api QuickTimeUTC option will adjust the time for video files properly.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Mat

I am on Mac and we don't have a "Date Taken" option. But the thing is I want to have my pictures in the correct timeline on OneDrive pictures. I did some more digging and found your command line in an other forum.

exiftool -wm cg -d %s -tagsfromfile %d%f.%e.json "-AllDates<PhotoTakenTimeTimestamp" /path/to/files/
It feels like this is the cleanest way to change the pictures from Google takeout to the correct timeline for OneDrive. Except for 5% what used to be 20% so thank you for that!

The new command line that u proposed I have not seen before. Should I try that one first?

I want to find a way to get the last 5% of my pictures in the correct timeline. Can you help me?

If you need more information on the last 5% it is mostly jpg, png, mov, mp4 and heic.

With kind regards,

Mat

Mat

Okay, so the command line you proposed seems to do the trick even better.

exiftool -api QuickTimeUTC "-FileModifyDate<CreateDate" "-FileModifyDate<DateTimeOriginal" /path/to/files/
Now I only have a handful of photos that are not properly replaced with the date. It is all pictures from downloaded media, I will have to look in-depth at why those pictures didn't work. Thank you for that.

Right now they are correct in the timeline on my Mac if I filter on Date modified, but will this also be the case if I upload them to Onedrive?

With kind regards,

Mat

StarGeek

Quote from: Mat on May 02, 2023, 02:13:30 AMI did some more digging and found your command line in an other forum.

exiftool -wm cg -d %s -tagsfromfile %d%f.%e.json "-AllDates<PhotoTakenTimeTimestamp" /path/to/files/
It feels like this is the cleanest way to change the pictures from Google takeout to the correct timeline for OneDrive.

I was about to say this is the command overwrite your original data, the exact one you should not run, but it has the -wm (-writeMode) option which is set to not overwrite any existing data.  You could run this and it will only write to any file that doesn't already have a DateTimeOriginal (and a couple others).

But as I said above, the time stamp in the json file is set to UTC and unless you you live in Western European Time (WET) time zone, it contains the wrong time.  It will be off by the actual time zone of where the image was originally taken.

Quote from: Mat on May 02, 2023, 02:29:34 AMNow I only have a handful of photos that are not properly replaced with the date. It is all pictures from downloaded media, I will have to look in-depth at why those pictures didn't work.

Downloaded files, especially those from social media like Facebook/Instagram or from sources like WhatsApp or texts (MMS), strip away all metadata, so the DateTimeOriginal was never there to begin with.  This is one of two times I feel is acceptable to write data from the json, the other being edits on the website, as mentioned above.

Use the command you found that includes the "PhotoTakenTimeTimestamp".  As long as -wm cg is part of that command, then none of the original data will be lost.

QuoteRight now they are correct in the timeline on my Mac if I filter on Date modified, but will this also be the case if I upload them to Onedrive?

This I do not know.  I am not willing to install OneDrive for testing.  It's bad enough that I have to use Google Drive and Dropbox and let them look at my files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype