本文介绍了为什么我的_getexif()返回None?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下Python脚本:

from PIL import Image
from PIL.ExifTags import TAGS

img = Image.open('/path/1.jpg')
info = img._getexif()
print info

为什么info返回为None,尽管我确保已读取img?

Why is info returned as None, although that I made sure that img has been read?

谢谢.

推荐答案

我认为问题在于,与使用手机相机拍摄的图像相反,我正在读取的图像似乎最初没有exif数据例如,我正在阅读的图像显然没有.

I think the issue was because the image I was reading seemed not to have exif data in the first place, as opposed to the images taken using a mobile phone camera for instance, which the image I was reading apparently hasn't.

这篇关于为什么我的_getexif()返回None?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 10:12