I need to know the properties of an image data taken (day, time, hour, minute, second)
import exifread
import os
directoryInput=r"C:\tekstilshiki"
for filename in os.listdir(directoryInput):
if filename.endswith('.jpg'):
with open(r"%s\%s" % (directoryInput, "11.jpg"), 'rb') as image: # directory and name bleat
exif = exifread.process_file(image)
dt = str(exif['EXIF DateTimeOriginal'])
# into date and time
day, dtime = dt.split(" ", 1)
hour, minute, second = dtime.split(":", 2)
When you run the script Goes error
Traceback (most recent call last): File "C:/tekstilshiki/ffd.py", line 8, in dt = str(exif['EXIF DateTimeOriginal']) KeyError: 'EXIF DateTimeOriginal'
I assume that the tag name is not correct
How can I read from all EXIF properties only the key time and the capture dateng