从图像中提取Exifdata

时间:2018-08-12 11:09:10

标签: python python-imaging-library exif

我正在处理一个python脚本,该脚本从png文件中提取exif数据,尽管我遇到了一个我不知道要解决的错误,但我得到了这个错误: AttributeError:“ PngImageFile”对象没有属性“ _getexif”

#! /usr/bin/env python

from PIL import Image
from PIL.ExifTags import TAGS
import sys

if len(sys.argv) == 1:
    print "Usage: %s <image file>" % sys.argv[0]
else:
    image = sys.argv[1]
    for (tag, value) in Image.open(image)._getexif().iteritems():
        print "%s = %s" %(TAGS.get(tag), value)

任何帮助表示赞赏:)

0 个答案:

没有答案
相关问题