jhead 是一个可以查看,修改照片 EXIF 信息的命令行工具,没有 GUI。
jhead 可以查看:
- Time and date picture was taken
 - Camera make and model
 - Integral low-res Exif thumbnail
 - Shutter speed
 - Camera F-stop number
 - Flash used (yes/no)
 - Distance camera was focused at
 - Focal length and calculate 35 mm equivalent focal length
 - Image resolution
 - GPS info, if stored in image
 - IPTC header
 - XMP data
 
jhead 可以修改:
- Up-right images according to rotation tag using jpegtran
 - Set or relative adjust internal exif timestamps
 - Fix date / time offsets in large batches of images
 - Re-name or date stamp files according to exif timestamp
 - Transfer exif headers between images
 - Replace thumbnails inside Exif headers
 - Edit jpeg comments (but not the Exif comments)
 - Delete exif or comment sections from jpeg images
 - Create new minimal exif header containing date and thumbnail
 
installation
sudo apt install jhead
usage
jhead 的使用官方网站 有着非常详细的说明,这里只挑重点。
查看
jhead demo.jpg
jhead -v demo.jpg
将 EXIF 信息保存到文本
jhead -v demo.jpg > exif.txt
设置 comment
jhead -cl <comment> path/to/file.jpg
jhead -ce file.jpg          # 执行命令后会调用外部编辑器,保存内容到 comment
jhead -cs <output-filename> file.jpg        # 将 comment 内容保存到 output-filename
jhead -ci <input-filename> file.jpg         # 将 input-filename 中的内容保存到照片 comment
删除信息
jhead -dc 删除 jpg 信息备注
jhead -de 完全删除 EXIF
jhead -du 删除非原始信息,比如 PS 携带的额外信息
jhead -purejpg      相当于 -dc -de -du
jhead -di 删除 IPTC 信息
jhead -dx 删除 XMP 信息
其实命令行工具最大的作用就是批处理,用正则,可以同时处理非常多的文件。
其他
更强大的工具 exiftool
如果寻找编程接口 可以查看 libexif 或者 exifv2