aboutsummaryrefslogblamecommitdiff
blob: a69742fef2ae8ae9101ee2b526fd82a6102c5405 (plain) (tree)



























                                                                                                         
import os
import pathlib
import platform
import sys
import exiftool
from pathlib import Path
from collections import defaultdict
from pprint import pprint


raw_dir = "/mnt/pool1/Media/Photo/RAW/2024/202404/Italy"

focal_length = defaultdict(int)
count = 0

if __name__ == "__main__":
    path = Path(raw_dir)
    for dirpath, dirnames, files in os.walk(path):
        if len(files) != 0:
            for f in files:
                if f.endswith(".DNG") and "PXL_" not in f:
                    filename = dirpath + "/" + f
                    with exiftool.ExifToolHelper() as et:
                        for d in et.get_tags(filename, tags="EXIF:FocalLengthIn35mmFormat"):
                            count += 1
                            print("{}: {} {}".format(count, filename, d["EXIF:FocalLengthIn35mmFormat"]))
                            focal_length[d["EXIF:FocalLengthIn35mmFormat"]] += 1
    pprint(focal_length)
Powered by cgit v1.2.3 (git 2.41.0)