Exif阅读图书馆 [英] Exif reading library

查看:115
本文介绍了Exif阅读图书馆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Python 3.x中是否有exif库?似乎我遇到的每个exif库都只适用于Python 2.x.我不需要任何太花哨的东西。只需读取这些值即可。

Is there an exif library out there for Python 3.x? It seems every exif library I run into is for Python 2.x only. I don't need anything too fancy. Just reading the values is enough.

推荐答案

选项1.使用pyexiv2。请参阅: pyexiv2 Bug#824440:Python 3支持你需要boost-python for py3k并且还可以手动应用在上面的bug末尾发布的补丁,但除此之外它可以工作。可能最容易在最新的Ubuntu下启动和运行。

Option 1. Use pyexiv2. See: pyexiv2 Bug #824440: Python 3 support You need boost-python for py3k and also to manually apply the patch posted at the end of the bug above, but aside from that it works. Probably easiest to get up and running under latest Ubuntu.

选项2.使用 PIL 下行:这个分支/分叉似乎没有积极开发。

Option 2. Use PIL Downside: this branch/fork doesn't seem to be actively developed.

from PIL import Image
from PIL.ExifTags import TAGS

image = Image.open("test.jpg")
exif = image._getexif()
# decode exif using TAGS

选项3.使用PythonMagick

Option 3. Use PythonMagick

from PythonMagick import Image

img = Image("image.jpg")
print img.attribute("EXIF:Orientation")

另请参阅:用于python的Exif操作库

这篇关于Exif阅读图书馆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆