Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def dump_exif(f):
print("File", f, ":")
try:
info = exif.getexif(f)
except exif.ExifException as e:
print(" Error:", e)
else:
for k in sorted([k for k in info if isinstance(k, str)]) + sorted([k for k in info if not isinstance(k, str)]):
print(" ", k, ":", user_repr(info[k]))
print(" file creation time:", file_time_creation(f))
def iminfo(f):
try:
info = cleanup_exif_tags(exif.getexif(f))
except exif.ExifException:
info = {}
if "DateTimeOriginal" in info:
info["DateTime"] = info["DateTimeOriginal"]
if "DateTime" not in info:
info["DateTime"] = file_time_creation(f)
return info