【发布时间】:2013-06-26 13:51:38
【问题描述】:
我正在尝试打印图像的 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>
如何解决这个错误?
【问题讨论】:
-
这似乎是一个错误,并在 master 中修复:github.com/dahlia/wand/commit/…
-
所以这是一个错误...谢谢。
-
对不起,我应该如何使用固定版本?我用新的替换了旧的 image.py 和 tests/image_test.py 并使用 python setup.py install 安装了它。但现在我收到此错误: ImportError: cannot import name encode_filename
-
试试 pip install git+git@github.com/dahlia/wand.git@0.3-maintenance#egg=Wand-0.3.2dev
-
pip 给出了一个错误(预期版本规范),但我下载了 wand-0.3-maintenance.zip 并使用 python install 安装它,python 代码终于可以工作了。谢谢
标签: python-3.x imagemagick wand