#!/usr/bin/python3
#基于 Pillow
# pip install pillow
from PIL import Image, ExifTags
img = PIL.Image.open("test.jpg")
exif_data = {
ExifTags.TAGS[i]: j
for i, j in img._getexif().items()
if i in ExifTags.TAGS}
print(exif_data)
#基于 ExifRead
# pip install ExifRead
import exifread
filename = open("test.jpg", 'rb')
tags = exifread.process_file(filename)
print(tags)
Last modification:January 17th, 2022 at 02:38 pm
© 允许规范转载