2024-04-26 00:22:53 发布
网友
好的,我用Windows照片库在我的一张照片上贴了个标签。 我想用PIL检查这个标签。你知道吗
我知道:
from PIL import Image img = Image.open('myimg.jpg') exif_data = img._getexif() print(exif_data) # outputs a lot of hex
但只要看到一堆六角文字。如何获得添加到照片中的新标签? 谢谢。你知道吗
您正在打印EXIF字典,该字典是在EXIF数字标记上键入的。你知道吗
您需要知道要查找的条目的数字标记,或者使用PIL.ExifTags映射将数字转换为可读字符串:
PIL.ExifTags
exif = {PIL.ExifTags.TAGS.get(k, k): v for k, v in img._getexif().iteritems()}
您仍然需要弄清楚要使用哪个标记名。你知道吗
print exif['exif_tag_you_are_looking_for']
您正在打印EXIF字典,该字典是在EXIF数字标记上键入的。你知道吗
您需要知道要查找的条目的数字标记,或者使用
PIL.ExifTags
映射将数字转换为可读字符串:您仍然需要弄清楚要使用哪个标记名。你知道吗
相关问题 更多 >
编程相关推荐