aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..ce1a747
--- /dev/null
+++ b/test.py
@@ -0,0 +1,22 @@
1from PIL import Image, ExifTags
2from PIL.ExifTags import TAGS
3from iptcinfo3 import IPTCInfo
4import exiftool
5import io
6
7im = Image.open("2023-03-10 17-49-50-00-IMG_8077.jpg")
8
9img_byte_arr = io.BytesIO()
10im.save(img_byte_arr, format='webp')
11img_byte_arr.seek(0)
12# img_byte_arr = img_byte_arr.getvalue()
13
14with exiftool.ExifToolHelper() as et:
15 metadata = et.get_metadata([img_byte_arr.getvalue()], raw_bytes=True)
16 for d in metadata:
17 # print("{:20.20} {:20.20}".format(d["SourceFile"],
18 # d["EXIF:DateTimeOriginal"]))
19 iso = d["EXIF:ISO"]
20 f = d["EXIF:FNumber"]
21 exp = d["EXIF:ExposureTime"]
22 print(f"{iso} {f} {exp}") \ No newline at end of file
Powered by cgit v1.2.3 (git 2.41.0)