Las*_*erh 4 json exiftool google-photos
我想留下Google照片,并且已经使用Google Takeout下载了所有照片。现在,我有一大堆包含json文件(我认为包含exif数据)和图像的文件夹。结构如下所示:home / user / Billeder / Takeout / Google Photos / 2011-06-09 / file.json。主页/用户/ Billeder / Takeout(2)/ Google相册/2011-07-09/file.json。
我想将json数据与正确的图像结合起来,并在与它们的创建日期相对应的文件夹中组织图像。我一直在看Exiftool,但是到目前为止找到的所有答案仅显示了如何针对单个图像执行此操作。我正在寻找的是一种将所有数据与正确的图像批量合并的方法。
我正在尝试在linux命令行中执行此操作。有没有办法做到这一点?
从版本10.47开始,Exiftool现在可以执行此操作。
In my testing, I've seen two different formats for the json filename, some where it is filename.ext.json
and some where it is filename.json
(no extension in the json filename). Here are two command to cover either situation. If you have a mixtures, as I do, run both.
Files with extension in the json filename
exiftool -tagsfromfile '%d/%F.json' '-ImageTag<JsonTag' FileOrDir
Files without extension in the json filename
exiftool -tagsfromfile '%d/%f.json' '-ImageTag<JsonTag' FileOrDir
Replace FileOrDir
with the file or directory you wish to process. Replace ImageTag
with the name of the tag in the image you want to copy to. Replace JsonTag
with the name of the tag from the json file you wish to copy from. If you are on Windows instead of linux, use double quotes instead of single quotes.
Here are some of the more useful tags that I've encountered in the json file and my suggestions where to copy them. Two of the tag names, Description and Title, are the same as the related XMP tags, so they don't need to be redirected into the image tag name and can be left simply as -Description
or -Title
in the above commands.
description: Description of the file. The appropriate placement for this would be IPTC:Caption-Abstract, XMP:Description, and EXIF:ImageDescription. You could copy these with '-Caption-Abstract<Description'
, -Description
, or '-ImageDescription<Description'
.
title: Name of the uploaded file. This can be copied into Title
, ObjectDescription
or PreservedFileName
.
people: Not sure but I'm guessing that if the file has had people tagged in a program such as Picasa, this would be the list of names, most likely from the RegionPersonDisplayName
.
url: This is an URL that the image can be downloaded from. WARNING: It is a publicly shared URL and even if the image is marked private, it can still be downloaded with this URL.
GeoInfoAltitude_, GeoInfoLatitude_, and GeoInfoLongitude_: If the uploaded file was geotagged, these will be the Altitude, Latitude, and Longitude for the image. These would best be copied into GPSAltitude
, GPSLatitude
, GPSLatitudeRef
, GPSLongitude
, and GPSLongitudeRef
. Because of the nature of GPS tags (unsigned), image that are in the Western and/or Southern hemisphere must also have the Ref tags set.
Example commands:
Copy gps tags
exiftool -tagsfromfile '%d/%F.json' '-GPSAltitude<GeoInfoAltitude_' '-GPSLatitude<GeoInfoLatitude_' '-GPSLatitudeRef<GeoInfoLatitude_' '-GPSLongitude<GeoInfoLongitude_' '-GPSLongitudeRef<GeoInfoLongitude_' FileOrDir
Copy Keywords
exiftool -tagsfromfile '%d/%F.json' '-Keywords<Tags' '-Subject<Tags' FileOrDir
Copy Description
exiftool -tagsfromfile '%d/%F.json' '-Caption-Abstract<Description' '-ImageDescription<Description' -Description FileOrDir
Edit (Jan 2018): As always, Google will change everything. The above GeoInfo* tags are deprecated according to the comment below and have been replaced by GeoDataAltitude, GeoDataLatitude, and GeoDataLongitude.
Exiftool can read Json files, so if there are other changes, running the command exiftool -s FILE.Json
will list all the tags and available data that can be copied.
正如 Pieter 提到的,作为 2020 年 12 月的更新,有一个专用工具花了我大约 5 分钟的时间来设置:https ://github.com/mattwilson1024/google-photos-exif 。
但是,这并不能解决其他答案中提到的问题(PHOTO_NAME(1).jpg
与 混淆PHOTO_NAME.jpg(1).json
)以及时区。更重要的是,这里的答案都不会覆盖 QuickTime 和 PNG 特定的标签。
我发现这个软件https://metadatafixer.com/更简单。虽然要花钱,但这是值得的。
归档时间: |
|
查看次数: |
6392 次 |
最近记录: |