exiftool 写入 xmp 标签

exiftool write xmp tag

我正在尝试使用 exiftool 为 XMP 标签写入一个新值,但由于某些原因无法识别该标签。

阅读田野作品:

exiftool -PropertyId /Users/user/test.jpg
Property Id                     : 17934

但是当尝试为 PropertyId 标记写入值时,work.I 也尝试使用 -xmp:PropertyId 但我得到了相同的结果:

exiftool -PropertyId=12345 /Users/user/test.jpg
Warning: Tag 'PropertyId' is not defined
Nothing to do.

导出元数据显示该字段在那里:(我只复制了xmp部分)

exiftool -xmp -b -a /Users/user/test.jpg > data.xmp
...
 <rdf:Description rdf:about=''
  xmlns:xmp='http://ns.adobe.com/xap/1.0/'>
  <xmp:Brand>Brand Name</xmp:Brand>
  <xmp:CreateDate>2015-07-08T11:45:21</xmp:CreateDate>
  <xmp:CreatorTool>CreatorTool</xmp:CreatorTool>
  <xmp:FacilityName>The Restaurant Name</xmp:FacilityName>
  <xmp:MetadataDate>2015-09-14T13:12:51-06:00</xmp:MetadataDate>
  <xmp:ModifyDate>2015-09-14T13:12:51-06:00</xmp:ModifyDate>
  <xmp:PropertyId>00000</xmp:PropertyId>
  <xmp:PropertyName>Property Name</xmp:PropertyName>
  <xmp:ShootDate>2016-03-12</xmp:ShootDate>
 </rdf:Description>...

我错过了什么?测试文件在这里:test.jpg

Exiftool 无法编辑它没有定义的元数据,就像在这种情况下一样。事实上,您的示例 XMP 显示了很多标签,它说这些标签是 "xap" 组的一部分,但实际上并不是该(非常旧的)标准的一部分,包括 BrandFacilityNamePropertyName,和 ShootDate。你会发现其中 none 可以直接由 exiftool 编辑。除了最初编写它的程序之外,可能不是任何其他程序。

如果您希望 exiftool 能够编写这些标签,您需要为这些标签创建定义。有关详细信息,请参阅 ExifTool Example Config file

另请注意,正如我所说,"xap" 是一个非常古老的标准,早已被取代。 Exiftool 会将它知道的标签更新为更新的标准。有关详细信息,请参阅 XMP xmp tags entry