A few files wont update the date/time from the json file

Started by George.e, June 20, 2021, 04:03:07 AM

Previous topic - Next topic

George.e

Hi,

I have run the software, which worked for 90% of the files.
However, for some reason a handful of files (800-ish) didn't update with the date taken from the json file. I am unsure why, or what to do. The json file seems to look to be in the same format as all the others that did work.

This is all from a google photo download too.

I have attached 2 files, a sample photo file and the associated .json file that didnt update.

Thank you for any assistance in getting this to work!

George

StarGeek

It's hard to help trouble shoot without knowing what command you used and what the exact output was.

But assuming the usual Google Takeout type command, your example updated correctly here.
C:\>exiftool -g1 -a -s -PhotoTakenTime* Y:\!temp\bb\IMG_2531.JPG.json
---- JSON ----
PhotoTakenTimeFormatted         : Jul 13, 2015, 4:53:33 PM UTC
PhotoTakenTimeTimestamp         : 1436806413

C:\>exiftool -P -overwrite_original -d %s -TagsFromFile %d%F.json "-AllDates<PhotoTakenTimeTimestamp" Y:\!temp\bb\IMG_2531.JPG
    1 image files updated

C:\Programs\My_Stuff>exiftool -time:all -g1 -a -s Y:\!temp\bb\IMG_2531.JPG
---- System ----
FileModifyDate                  : 2021:06:20 08:44:30-07:00
FileAccessDate                  : 2021:06:20 08:48:34-07:00
FileCreateDate                  : 2021:06:20 08:44:30-07:00
---- IFD0 ----
ModifyDate                      : 2015:07:13 16:53:33
---- ExifIFD ----
DateTimeOriginal                : 2015:07:13 16:53:33
CreateDate                      : 2015:07:13 16:53:33
"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

George.e

I didn't do anything to adjust the commands, i simply dragged and dropped the folder onto to run file in windows and it just ran...
I don't know or understand how to change the commands? I just downloaded the windows version software and ran it as standard.
That's great that you got it to work though, is there something im missing in order to change the command?
George

George.e

see attached the output i am receiving. I had to put it into a notepad to save it.
George

StarGeek

That's just the output from a drag/drop onto the exiftool(-k).exe program.  That alone won't copy any data at all.
"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

George.e

what should i rename the file to exactly to make the execution work?
thank you for all your help!

StarGeek

I have no idea what you're doing.  You said you "run the software, which worked for 90% of the files" but nothing you've shown tells me what command you ran or what you are trying to do.
"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

George.e

I have only run everything through the software named as exiftool(-k) by dragging files onto the software
I didnt change anything with the software
If that wouldnt have made any changes to the files, i am wondering if 90% of the files already had the correct "dates" already in the files and didnt need the metadata copied across
hence the other 10% of files which have it missing it didnt work for, as i am using it wrong

What settings did you have, filename, and how did you run it to make it work?
Sorry, i really dont understand code to this degree :(

George

StarGeek

Quote from: George.e on June 20, 2021, 12:38:42 PM
If that wouldnt have made any changes to the files, i am wondering if 90% of the files already had the correct "dates" already in the files and didnt need the metadata copied across

Because Google does not remove any metadata from the files.  The files you downloaded are exactly the same as you uploaded.  You do not need to do anything to the files unless you made changes on the Google website.
"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

George.e

Ok, then i still have 800 ish files that need adjusting just like the one i sent at the beginning.
that was one of the 800...
how do i run the system to change the date/time within the photo to match the date/time in the json file?

thank you

george

StarGeek

Rename exiftool to remove the (-k) part.  Depending upon your settings it will end up as either exiftool or exiftool.exe

Open up a CMD window hitting WindowKey+R, type "CMD" and hit enter

Drag the exiftool icon onto the CMD window

Hit space

Copy and paste this into the CMD window
-r -wm cg -overwrite_original -d %s -TagsFromFile %d%F.json "-AllDates<PhotoTakenTimeTimestamp"

Hit space

Drag the top folder from your Google Takout onto the CMD window

Hit Enter

Exiftool will then start processing all your files.  This command will not overwrite the data in files that already have data.

There will be errors that pop up.  Most often in cases where you have duplicate filenames where there is a copy number in parenthesis.

This will take care of most of the images.  The rest will be to complex to fix without spending hours teaching you about the command line. 

Anything left over is going to be stuff that never had a timestamp in the first place such as screenshots and the json files will only have the time you uploaded the file.
"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

George.e

Thank you, that seems to have worked for a few
one of the errors it popped up with was that some files are a jpeg file, and so the command didnt work for those ones

example:
Error: Not a valid PNG (looks more like a JPEG) - C:/Users/Customer/Pictures/Saved Pictures/Takeout/Google Photos/Photos from 2018/IMG_6480.PNG

and separately, for mp4:
Warning: Error opening file - C:/Users/Customer/Pictures/Saved Pictures/Takeout/Google Photos/Photos from 2018/IMG_6538.MP4.json

would they each be just different commends?
would it be possible to just tell me what i would need to "copy/paste" as a commend to run for those file formats.

I really appreciate all your help with this, lifesaver!

George

George.e

Further to my first point about jpeg, this is another error, might be relevant?

Error: Not a valid HEIC (looks more like a JPEG) - C:/Users/Customer/Pictures/Saved Pictures/Takeout/Google Photos/Photos from 2018/IMG_2744.HEIC

George

StarGeek

The files that say they look like jpgs are probably jpgs, not PNG or HEIC files.  Rename them to have the proper file extension.

For the MP4, there might not be any matching json file.  I've seen that happen in my tests.

You also might search these forums for answers.  There's a lot of previous solutions.  This Google search will limit results to this website.
"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

jwilleke

Using this line:

exiftool --ext pdf --ext json --ext log --ext _gs --ext gsl -p '$directory/$filename -if 'not $datetimeoriginal' -r .
I get most files have a value but some report

Warning: [Minor] Tag 'datetimeoriginal' not defined - ./2003-10-21-MortonWestElevation.jpg
How can I have the first line update from a json file (Google takeout) only if the datetimeoriginal is missing form the image file?

Thanks for the tool and all the help!