python - 从列表中获取图像标签的值
问题描述
我正在使用 python 来提取图像元数据。图像被放置在一个文件夹中,图像被添加到 python 的列表中。之后我从这些图像中提取标签和值,但它说 AttributeError: 'function' object has no attribute 'get' at value = val1.get(tagid)
代码也附上
exifdata = []
images_length = len(imagesList)
for i in range(images_length):
metavar = imagesList[i].getexif
exifdata.insert(i,metavar)
exif_length = len(exifdata)
for i in range(exif_length):
for tagid in iter(exifdata):
# getting the tag name instead of tag id
tagname = TAGS.get(tagid, tagid)
# passing the tagid to get its respective value
val1 = exifdata[i]
value = val1.get(tagid)
# printing the final result
print(f"{tagname:25}: {value}")
有谁知道代码有什么问题?
解决方案
推荐阅读
- jenkins - Jenkins stash 没有隐藏所有文件和文件夹
- ubuntu - 颤振医生无法识别Android Studio颤振和飞镖插件,但已安装插件
- javascript - 电话屏蔽功能在表单字段中插入额外的“x”
- laravel - 如何为我的 laravel 项目进行更新?
- java - 成功登录后 Spring boot oAuth2“Bad Credentials”
- javascript - Cordova 键盘更改布局
- apache-spark - 将类型安全配置 conf 文件传递给 DataProcSparkOperator
- python - Paramiko 与 Windows 的连接静默失败(似乎成功)
- objective-c - Objective C - 带有谓词的过滤器数组
- html - 如何在 index.html 主页上显示 wordpress 登录表单?