This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
def new_filename_from_mtime(filename): | |
new_filename = time.strftime('%Y%m%d%H%M%S', | |
time.strptime( | |
time.ctime(os.path.getmtime(filename)))) | |
return new_filename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import exifread | |
def new_filename_from_exif(filename): | |
new_filename = None | |
with open(filename, 'rb') as f: | |
tags = exifread.process_file(f) | |
if 'EXIF DateTimeOriginal' in tags: | |
exif_date_time_original = tags['EXIF DateTimeOriginal'] |
NewerOlder