4

图片的 exif 查看和设置工具 exiftool

 3 years ago
source link: https://zhiqiang.org/it/exiftool.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

图片的 exif 查看和设置工具 exiftool

作者: 张志强

, 发表于 2020-05-18

, 共 454 字 , 共阅读 4 次

exiftool 在命令行下查看和设置图片的 exif。

sudo apt install libimage-exiftool-perl

查看所有 exif 元数据:

exiftool ./s.jpg

查看一个元元素可以直接用:

exiftool -tag ./s.jpg

设置元数据(注意修改在原文件即时生效):

exiftool -tag=value ./s.jpg

支持的标签参考exiftool tag names,常用的有下面几个:

  • DateTimeOriginal, 格式: YYYY:MM:DD HH:mm:ss。

Python 包pyexif可配合 exiftool ,在 Python 下使用。提供几个常用函数:

  • getTag(tag)
  • setTag(tag, value)
  • getOriginalDateTime()
  • setOriginalDateTime(dt)

注意,这里的 tag 不支持自定义 tag ,必须使用文件格式自己支持的 tag

Q. E. D.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK