aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclarkzjw <[email protected]>2023-07-26 12:20:17 -0700
committerclarkzjw <[email protected]>2023-07-26 12:20:17 -0700
commitaababfa10094321c5f06b4cfdd28b6ef3a252846 (patch)
tree448d5df8a555649ff517f344a5a1dcc30e3437ed /test.py
parent78d996f287ecc2c4ab8c4580f8d2ba0a1eed963e (diff)
downloadphoto-aababfa10094321c5f06b4cfdd28b6ef3a252846.tar.gz
test exifexif
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)