Advertisement
carbolymer

Untitled

Jul 4th, 2018
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. def get_new_file_name(jpg_path):
  2.     try:
  3.         exif_dict = piexif.load(jpg_path)
  4.         # success - return new file name based on exif
  5.     except (piexif._exeptions.InvalidImageDataError, KeyError):
  6.         print('cannot read exif data for file: ' + jpg_path)
  7.         # 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