Merging jpg.json files with .jpg export google takeout

Started by Gabriel.carvalho, July 03, 2020, 02:10:05 PM

Previous topic - Next topic

Gabriel.carvalho

Merging jpg.json files with .jpg export google takeout
Guys I really need your help, I exported the images from google photos by takeout. And stupidly I deleted all images from google photos. I need your help to merge the information from jpg / mp4.json files with jpg / mp4. I just wanted to keep the photo creation dates.
I will leave an example here, I am Brazilian and I do not understand exiftool very well.

I believe that almost all .jpg files are in this format. I just don't know how the .mp4 files are doing

Folders are organized this way
2012-09-15
2012-10-27
2013-09-01
2013-09-15
2013-09-15#2


Exemplo .jpg file

PS F:\Celular\teste\2013-09-17> exiftool -s 1236882_457790700985342_799464616_n.jpg
ExifToolVersion                 : 12.01
FileName                        : 1236882_457790700985342_799464616_n.jpg
Directory                       : .
FileSize                        : 92 kB
FileModifyDate                  : 2020:06:27 17:55:04-03:00
FileAccessDate                  : 2020:07:03 14:56:04-03:00
FileCreateDate                  : 2020:07:02 22:12:34-03:00
FilePermissions                 : rw-rw-rw-
FileType                        : JPEG
FileTypeExtension               : jpg
MIMEType                        : image/jpeg
JFIFVersion                     : 1.01
ExifByteOrder                   : Little-endian (Intel, II)
Software                        : Picasa
ExifVersion                     : 0220
ExifImageWidth                  : 960
ExifImageHeight                 : 572
ImageUniqueID                   : ce2c9a3211fb4b430000000000000000
Compression                     : JPEG (old-style)
XResolution                     : 72
YResolution                     : 72
ResolutionUnit                  : inches
ThumbnailOffset                 : 258
ThumbnailLength                 : 5954
XMPToolkit                      : XMP Core 5.5.0
ProfileCMMType                  : Little CMS
ProfileVersion                  : 2.1.0
ProfileClass                    : Display Device Profile
ColorSpaceData                  : RGB
ProfileConnectionSpace          : XYZ
ProfileDateTime                 : 2012:01:25 03:41:57
ProfileFileSignature            : acsp
PrimaryPlatform                 : Apple Computer Inc.
CMMFlags                        : Not Embedded, Independent
DeviceManufacturer              :
DeviceModel                     :
DeviceAttributes                : Reflective, Glossy, Positive, Color
RenderingIntent                 : Perceptual
ConnectionSpaceIlluminant       : 0.9642 1 0.82491
ProfileCreator                  : Little CMS
ProfileID                       : 0
ProfileDescription              : c2
ProfileCopyright                : FB
MediaWhitePoint                 : 0.9642 1 0.82491
MediaBlackPoint                 : 0.01205 0.0125 0.01031
RedMatrixColumn                 : 0.43607 0.22249 0.01392
GreenMatrixColumn               : 0.38515 0.71687 0.09708
BlueMatrixColumn                : 0.14307 0.06061 0.7141
RedTRC                          : (Binary data 64 bytes, use -b option to extract)
GreenTRC                        : (Binary data 64 bytes, use -b option to extract)
BlueTRC                         : (Binary data 64 bytes, use -b option to extract)
CurrentIPTCDigest               : b443520a10119da99c2550175e6d0efb
EnvelopeRecordVersion           : 4
CodedCharacterSet               : UTF8
ApplicationRecordVersion        : 4
IPTCDigest                      : b443520a10119da99c2550175e6d0efb
Comment                         : *
ImageWidth                      : 960
ImageHeight                     : 572
EncodingProcess                 : Baseline DCT, Huffman coding
BitsPerSample                   : 8
ColorComponents                 : 3
YCbCrSubSampling                : YCbCr4:2:0 (2 2)
ImageSize                       : 960x572
Megapixels                      : 0.549
ThumbnailImage                  : (Binary data 5954 bytes, use -b option to extract)


Exemplo jpg.json

PS F:\Celular\teste\2013-09-17> exiftool -s 1236882_457790700985342_799464616_n.jpg.json
ExifToolVersion                 : 12.01
FileName                        : 1236882_457790700985342_799464616_n.jpg.json
Directory                       : .
FileSize                        : 696 bytes
FileModifyDate                  : 2020:06:27 17:55:04-03:00
FileAccessDate                  : 2020:07:03 14:56:58-03:00
FileCreateDate                  : 2020:07:02 22:12:34-03:00
FilePermissions                 : rw-rw-rw-
FileType                        : JSON
FileTypeExtension               : json
MIMEType                        : application/json
CreationTimeFormatted           : 1 de mai. de 2016 15:50:51 UTC
CreationTimeTimestamp           : 1462117851
Description                     :
GeoDataAltitude                 : 0.0
GeoDataLatitude                 : 0.0
GeoDataLatitudeSpan             : 0.0
GeoDataLongitude                : 0.0
GeoDataLongitudeSpan            : 0.0
GeoDataExifAltitude             : 0.0
GeoDataExifLatitude             : 0.0
GeoDataExifLatitudeSpan         : 0.0
GeoDataExifLongitude            : 0.0
GeoDataExifLongitudeSpan        : 0.0
ImageViews                      : 0
ModificationTimeFormatted       : 28 de jun. de 2020 00:55:04 UTC
ModificationTimeTimestamp       : 1593305704
PhotoTakenTimeFormatted         : 18 de set. de 2013 00:38:14 UTC
PhotoTakenTimeTimestamp         : 1379464694
Title                           : 1236882_457790700985342_799464616_n.jpg




Phil Harvey

Basically, the command is like this:

exiftool -tagsfromfile %d%f.%e.json -description -title "-gpslatitude<GeoDataLatitude" "-gpslatituderef<GeoDataLatitude" "-gpslongitude<GeoDataLongitude" "-gpslongituderef<GeoDataLongitude" ... -ext mp4 -ext jpg DIR

You can add any other tags you want copied directly (ie. -TAG) and other tags you want redirected to another destination (eg. "-dsttag<srctag").

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

For the specific case of keeping the creation date, try
exiftool -d "%s" -tagsfromfile %d%f.%e.json "-DateTimeOriginal<PhotoTakenTimeTimestamp" -ext mp4 -ext jpg DIR
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Gabriel.carvalho

Hello, sorry for the delay in replying, I was without internet for 3 days, but come on.
Version
Windows 10
Exiftool 12.01
jpg and mp4
all GeoData are 0.0
CreationTimeFormatted dates are in PT-BR
1 de mai. de 2016 15:50:28 UTC
I will try to run the code you sent


Gabriel.carvalho

I don't know how to thank you, everything worked fine, thank you very much!!!

Gabriel.carvalho

I just saw there are also .png files

Example .png

Screenshot_20200330-115613.png
ExifTool Version Number         : 12.01
File Name                       : Screenshot_20200330-115613.png
Directory                       : .
File Size                       : 519 kB
File Modification Date/Time     : 2020:07:08 00:02:49-03:00
File Access Date/Time           : 2020:07:08 00:07:56-03:00
File Creation Date/Time         : 2020:07:07 11:26:15-03:00
File Permissions                : rw-rw-rw-
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 1080
Image Height                    : 1920
Bit Depth                       : 8
Color Type                      : RGB
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Significant Bits                : 8 8 8
Creation Time                   : 2020:07:07 23:44:10-03:00
Exif Byte Order                 : Big-endian (Motorola, MM)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Y Cb Cr Positioning             : Centered
Exif Version                    : 0232
Date/Time Original              : 2020:03:30 14:56:13
Components Configuration        : Y, Cb, Cr, -
Flashpix Version                : 0100
Color Space                     : Uncalibrated
Image Size                      : 1080x1920
Megapixels                      : 2.1


Example .png.json


Screenshot_20200330-115613.png.json
ExifToolVersion                 : 12.01
FileName                        : Screenshot_20200330-115613.png.json
Directory                       : .
FileSize                        : 707 bytes
FileModifyDate                  : 2020:06:26 18:28:24-03:00
FileAccessDate                  : 2020:07:08 00:00:35-03:00
FileCreateDate                  : 2020:07:07 11:26:17-03:00
FilePermissions                 : rw-rw-rw-
FileType                        : JSON
FileTypeExtension               : json
MIMEType                        : application/json
CreationTimeFormatted           : 30 de mar. de 2020 14:55:10 UTC
CreationTimeTimestamp           : 1585580110
Description                     :
GeoDataAltitude                 : 0.0
GeoDataLatitude                 : 0.0
GeoDataLatitudeSpan             : 0.0
GeoDataLongitude                : 0.0
GeoDataLongitudeSpan            : 0.0
GeoDataExifAltitude             : 0.0
GeoDataExifLatitude             : 0.0
GeoDataExifLatitudeSpan         : 0.0
GeoDataExifLongitude            : 0.0
GeoDataExifLongitudeSpan        : 0.0
ImageViews                      : 0
ModificationTimeFormatted       : 27 de jun. de 2020 01:28:24 UTC
ModificationTimeTimestamp       : 1593221304
PhotoTakenTimeFormatted         : 30 de mar. de 2020 14:56:13 UTC
PhotoTakenTimeTimestamp         : 1585580173
Title                           : Screenshot_20200330-115613.png
Trashed                         : true



i just add -ext png in exiftool -d "%s" -tagsfromfile %d%f.%e.json "-DateTimeOriginal<PhotoTakenTimeTimestamp" -ext mp4 -ext jpg DIR . it's run but with warning


I just wanted to modify the dates so that google photos recognize the correct place on the timeline. Can you help me please?






StarGeek

What are you having a problem with?  You're not giving any information to work with.

The command you list will copy the json time to the PNG DateTimeOriginal if you add -ext png.  Google Photos should be able to read it after that.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).