import piexif
file = "download.jpeg"
exif_dict = piexif.load(file)
print(exif_dict)
exif_dict["0th"][piexif.ImageIFD.XPKeywords] = "keyword;".encode("utf-16be")
print(exif_dict)
piexif.insert(piexif.dump(exif_dict), file)
I tried to encode the keyword before adding it to the exif data dictionary but for some reason it is only getting stored as a tuple and not showing up when I explore the properties in Windows.