Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_new_file_name(jpg_path):
- try:
- exif_dict = piexif.load(jpg_path)
- # success - return new file name based on exif
- except (piexif._exeptions.InvalidImageDataError, KeyError):
- print('cannot read exif data for file: ' + jpg_path)
- # failure - return other file name, not based on exif, in different directory, this is detected in the calling function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement