LeoHsiao1 / pyexiv2

Read and write image metadata, including EXIF, IPTC, XMP, ICC Profile.
GNU General Public License v3.0
196 stars 39 forks source link

How to set Exif.Image.ImageID properties #113

Closed Airyzf closed 11 months ago

Airyzf commented 11 months ago

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

LeoHsiao1 commented 11 months ago

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. https://github.com/Exiv2/exiv2/issues/1464