Batch Updating Metadata from JSON File to JPG Files

Started by akbaree, June 28, 2025, 07:39:17 AM

Previous topic - Next topic

akbaree

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.

akbaree

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.

StarGeek

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 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/
"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

akbaree

#3
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"

StarGeek

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.
"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

akbaree

Thank you, this worked. Really appreciate your help.