ExifTool Forum

ExifTool => Newbies => Topic started by: akbaree on June 28, 2025, 07:39:17 AM

Title: Batch Updating Metadata from JSON File to JPG Files
Post by: akbaree on June 28, 2025, 07:39:17 AM
I have seen this topic in the forum but still unable to achieve this use case. I recently took my photos out of Google and realized that I have lost Creation Date in the JPG files. The accompanying JSON files have the correction "Date Taken".

As these are 1000+ files the nested folder structure, I am trying to configure a command that I can execute to read the JSON file and update corresponding JPG file in a batch. Any help will be greatly appreciated.
Title: Re: Batch Updating Metadata from JSON File to JPG Files
Post by: akbaree on June 28, 2025, 09:40:58 AM
I used this command - exiftool  -d %s -tagsFromFile "DSCN6139.JPG.supplemental-metadata.json" "-DateTimeOriginal<PhotoTakenTimeTimestamp" "DSCN6139.JPG" and get one file updated at a time, but I need to perform this same operation for all files in the directory structure.
Title: Re: Batch Updating Metadata from JSON File to JPG Files
Post by: StarGeek on June 28, 2025, 10:25:56 AM
Have you checked your files first to make sure you need to do this. Google Does Not remove any metadata from your files. They have the same time stamp as when you uploaded them. See this post (https://exiftool.org/forum/index.php?msg=93391) where I go into detail showing that nothing needs to be done for one person.

Take one of your files and run this command on it to see all the time stamps in a file.
exiftool -time:all -G1 -a -s /path/to/file.jpg

In all probability, what you actually want to do is change the file system time stamps. That can be accomplished by copying the embedded time to the file system time stamps.
exiftool "-FileModifyDate<CreateDate" "-FileCreateDate<CreateDate" "-FileModifyDate<DateTimeOriginal" "-FileCreateDate<DateTimeOriginal" /path/to/files/
Title: Re: Batch Updating Metadata from JSON File to JPG Files
Post by: akbaree on June 29, 2025, 11:50:34 AM
Yes, I have seen that comment on other threads that Google doesn't remove the metadata. But not sure what's with my files, almost all of my files are like below...

[System]        FileModifyDate                  : 2025:06:28 12:23:10+05:30
[System]        FileAccessDate                  : 2025:06:29 21:13:18+05:30
[System]        FileCreateDate                  : 2025:06:29 21:12:51+05:30
[IFD0]          ModifyDate                      : 0000:00:00 00:00:00
[ExifIFD]       DateTimeOriginal                : 0000:00:00 00:00:00
[ExifIFD]       CreateDate                      : 0000:00:00 00:00:00

So I need to read the JSON file for PhotoTakenTime and update DateTimeOriginal tag in the JPG.
BTW, this is the command I am trying to recursively update my files and it is not working...

exiftool -r -d %s -tagsFromFile "%d%F.supplemental-metadata.json" "-DateTimeOriginal<PhotoTakenTimeTimestamp" "%d%F.JPG"
Title: Re: Batch Updating Metadata from JSON File to JPG Files
Post by: StarGeek on June 29, 2025, 12:51:21 PM
Try
exiftool -r -ext jpg -d %s -tagsFromFile "%d%F.supplemental-metadata.json" "-DateTimeOriginal<PhotoTakenTimeTimestamp" /path/to/files/

Replace /path/to/files/ with a dot . to use the current directory.

If that doesn't work, post the exact output.
Title: Re: Batch Updating Metadata from JSON File to JPG Files
Post by: akbaree on June 29, 2025, 01:08:19 PM
Thank you, this worked. Really appreciate your help.