ExifTool Forum

ExifTool => Newbies => Topic started by: Kalinox on January 17, 2021, 08:19:28 PM

Title: Extracting timestamp metadata from JSON and adding it to corresponding JPG's
Post by: Kalinox on January 17, 2021, 08:19:28 PM
Background: I am somewhat of a novice and only recently discovered the ExifTool and JSON format. I have a MacBook Pro that runs MacOS Big Sur Version 11.0.1. I have installed the ExifTool.

So, this is my situation:

I would like to use the ExifTool via the Terminal to batch/bulk extract the "creation_timestamp" from the .json file for every photo and use it to overwrite the timestamp of the corresponding photos. (Note: the "creation_timestamp" in the .json file seems to be in UNIX format — 10 digits — and may need converting???).

Thank you for any help that you may be able to offer. For your reference, I am attaching:

Please let me know if there's anything that you need me to elaborate on or clarify. Thanks again!
Title: Re: Extracting timestamp metadata from JSON and adding it to corresponding JPG's
Post by: StarGeek on January 17, 2021, 08:50:49 PM
That json file is significantly different from the formats that Google Photos and Flickr use.  I think there would be some editing of the json file required before it could be used with exiftool.

I'm assuming that the images listed are from March 2009?  That would be the date if the "creation_timestamp" entry is epoch time.

What is the output of this command when you run it on the json file. 
exiftool -G1 -a -s file.json
Copy/paste the output instead of a screenshot.  Don't need the whole thing if there's a lot of files, just enough to see the details.
Title: Re: Extracting timestamp metadata from JSON and adding it to corresponding JPG's
Post by: Kalinox on January 17, 2021, 09:04:58 PM
Thanks for your reply, StarGeek.

Yes, the files are from March 2009.

Here is the output I got:

kalinoxs-mbp:~ kalinox$ exiftool -G1 -a -s /Users/kalinox/Desktop/photos_and_videos/AdmirablePeople_ousmgdJMjg/0.json
[ExifTool]      ExifToolVersion                 : 12.14
[System]        FileName                        : 0.json
[System]        Directory                       : /Users/kalinox/Desktop/photos_and_videos/AdmirablePeople_ousmgdJMjg
[System]        FileSize                        : 1316 bytes
[System]        FileModifyDate                  : 2021:01:15 10:14:38-05:00
[System]        FileAccessDate                  : 2021:01:15 10:14:38-05:00
[System]        FileInodeChangeDate             : 2021:01:17 20:00:49-05:00
[System]        FilePermissions                 : rw-rw-rw-
[File]          FileType                        : JSON
[File]          FileTypeExtension               : json
[File]          MIMEType                        : application/json
[JSON]          Cover_photoCreation_timestamp   : 1236610912
[JSON]          Cover_photoDescription          : Nelson Mandela.
[JSON]          Cover_photoTitle                : -☆- Admirable People -☆-
[JSON]          Cover_photoUri                  : photos_and_videos/AdmirablePeople_ousmgdJMjg/1929078_55985188870_4345868_n_55985188870.jpg
[JSON]          Description                     : Album of people that I believe make this world a better place.
[JSON]          Last_modified_timestamp         : 1236612914
[JSON]          Name                            : -☆- Admirable People -☆-
[JSON]          PhotosCreation_timestamp        : 1236610912, 1236611787, 1236612764
[JSON]          PhotosDescription               : Nelson Mandela., Steve Jobs., Steve Irwin.
[JSON]          PhotosTitle                     : -☆- Admirable People -☆-, -☆- Admirable People -☆-, -☆- Admirable People -☆-
[JSON]          PhotosUri                       : photos_and_videos/AdmirablePeople_ousmgdJMjg/1929078_55985188870_4345868_n_55985188870.jpg, photos_and_videos/AdmirablePeople_ousmgdJMjg/1929078_55988278870_7827430_n_55988278870.jpg, photos_and_videos/AdmirablePeople_ousmgdJMjg/1929078_55991583870_2891056_n_55991583870.jpg