写入exif元数据时,XPComment和XPKeywords不会出现
from PIL import Image
filepath = "yourFilepath.jpg"
image = Image.open(filepath)
XPComment = 0x9C9C
XPKeywords = 0x9C9E
exifdata = image.getexif()
exifdata[XPComment] = "new comment"
exifdata[XPKeywords] = "new keyword;"
image.save(filepath, exif=exifdata)
# ???? where's my exif data yo?
它需要以utf-16格式编码。所需的编码可能因计算机而异
相关问题 更多 >
编程相关推荐