我正在尝试打印图像的 EXIF。这是我的代码:
with Image(filename="/home/hapoofesgeli/Desktop/b.jpg") as image:
for k, v in image.metadata.items():
if k.startswith('exif:'):
print(k, v)
但它给出了一个错误:
Traceback (most recent call last):
File "/home/hapoofesgeli/Programming/Test/Test.py", line 5, in <module>
for k, v in image.metadata.items():
File "/usr/lib/python3.3/collections/abc.py", line 480, in __iter__
yield (key, self._mapping[key])
File "/usr/lib/python3.3/site-packages/wand/image.py", line 2260, in __getitem__
raise TypeError('k must be a string, not ' + repr(format))
TypeError: k must be a string, not <built-in function format>
如何解决这个错误?