From 23477dc11338f7b769c9fde95f73b18a9355c853 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Sat, 27 Apr 2024 18:18:31 -0700 Subject: add ricoh focal length stats --- ricoh_focal.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 ricoh_focal.py diff --git a/ricoh_focal.py b/ricoh_focal.py new file mode 100644 index 0000000..a69742f --- /dev/null +++ b/ricoh_focal.py @@ -0,0 +1,28 @@ +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) \ No newline at end of file -- cgit v1.2.3