-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
53 lines (43 loc) · 1.67 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
print("""
__________
.'----------`.
| .--------. |
| |########| | __________
| |########| | /__________\
.--------| `--------' |------| --=-- |-------------.
| `----,-.-----' |o ====== | |
| ______|_|_______ |__________| |
| / %%%%%%%%%%%% \ |
| / %%%%%%%%%%%%%% \ |
| ^^^^^^^^^^^^^^^^^^^^ Gigahertz Legacy-SpiderX |
+-----------------------------------------------------+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
""")
print(" --------------Extract EXIF data from image-------------")
print("")
print("1. Select image ")
print("2. Exit ")
print("")
user_input = int(input("Enter your choice: "))
if user_input == 1:
from PIL import Image
from PIL.ExifTags import TAGS
from tkinter import Tk
from tkinter.filedialog import askopenfilename
print("")
Tk().withdraw()
imagename = askopenfilename()
image = Image.open(imagename)
exifdata = image._getexif()
if isinstance(exifdata, dict):
for tag, value in exifdata.items():
decoded = TAGS.get(tag, tag)
print("%s: %s" % (decoded, value))
else:
print("No EXIF data found")
elif user_input == 2:
print("Exiting")
exit()
else:
print("Invalid input")
exit()