本文介绍了如何使用python从图像中提取元数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,我正在开发一个程序,该程序将打开图像,然后从图像中提取元数据 如何使用python提取元数据?
Hi im working on a program that will open an image and then extract the metadata from it How do i extract metadata using python ?
谢谢
推荐答案使用Pillow,它是仍在积极开发中的PIL的分支,并且支持python3.在这里,我使用字典生成器将exif数据映射到字典
Use Pillow, it's a fork of PIL that is still in active development, and supports python3. Here I use a dict generator to map the exif data to a dict
from PIL import Image, ExifTags img = Image.open("/path/to/file.jpg") exif = { ExifTags.TAGS[k]: v for k, v in img._getexif().items() if k in ExifTags.TAGS }更多推荐
如何使用python从图像中提取元数据?
发布评论