LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to set Exif.Image.ImageID properties

Airyzf opened this issue · comments

commented

Describe the bug
Why is Exif.Image.ImageID not displayed in the image properties after setting it?

To Reproduce
exif_dict['Exif.Photo.ImageID'] = 'hello666'
with open(save_path, 'rb+') as f:
with pyexiv2.ImageData(f.read()) as img:
img.modify_exif(exif_dict)
f.seek(0)
f.truncate()

获取图片的字节数据并保存到文件中

f.write(img.get_bytes())
f.seek(0)

Expected behavior
image

Desktop (please complete the following information):
OS and version: (Windows 11)
Exiv2 version and source: (e.g., 0.27.5 from exiv2.org)
Language: python
Version: pyexiv2 2.8.1

I tried it and exiv2 doesn't seem to support modifying this tag:

exiv2 -M'set Exif.Image.ImageID Ascii foobar' 1.jpg
exiv2 --grep ImageID 1.jpg

However, some users seem to be able to modify this tag.
Exiv2/exiv2#1464