zhiwenxuan / my-web-note

知识体系构建
16 stars 7 forks source link

Python piexif 修改图片exif 信息 #93

Open zhiwenxuan opened 1 year ago

zhiwenxuan commented 1 year ago
import piexif

for index in range(1, 81):
  path = "Drone Others " + str(index) + ".jpg"
  exif_dict = piexif.load(path)
  tag = piexif.ExifIFD.FocalLengthIn35mmFilm
  exif_dict["Exif"][tag] = 25
  exif_bytes = piexif.dump(exif_dict)
  piexif.insert(exif_bytes, path)