aboutsummaryrefslogblamecommitdiff
blob: ce1a747100d01c97edcef05bbbd33ef01ae14b6f (plain) (tree)





















                                                                         
from PIL import Image, ExifTags
from PIL.ExifTags import TAGS
from iptcinfo3 import IPTCInfo
import exiftool
import io

im = Image.open("2023-03-10 17-49-50-00-IMG_8077.jpg")

img_byte_arr = io.BytesIO()
im.save(img_byte_arr, format='webp')
img_byte_arr.seek(0)
# img_byte_arr = img_byte_arr.getvalue()

with exiftool.ExifToolHelper() as et:
    metadata = et.get_metadata([img_byte_arr.getvalue()], raw_bytes=True)
    for d in metadata:
        # print("{:20.20} {:20.20}".format(d["SourceFile"],
        #                                  d["EXIF:DateTimeOriginal"]))
        iso = d["EXIF:ISO"]
        f = d["EXIF:FNumber"]
        exp = d["EXIF:ExposureTime"]
        print(f"{iso} {f} {exp}")
Powered by cgit v1.2.3 (git 2.41.0)