diff options
-rw-r--r-- | ricoh_focal.py | 28 |
1 files changed, 28 insertions, 0 deletions
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 @@ | |||
1 | import os | ||
2 | import pathlib | ||
3 | import platform | ||
4 | import sys | ||
5 | import exiftool | ||
6 | from pathlib import Path | ||
7 | from collections import defaultdict | ||
8 | from pprint import pprint | ||
9 | |||
10 | |||
11 | raw_dir = "/mnt/pool1/Media/Photo/RAW/2024/202404/Italy" | ||
12 | |||
13 | focal_length = defaultdict(int) | ||
14 | count = 0 | ||
15 | |||
16 | if __name__ == "__main__": | ||
17 | path = Path(raw_dir) | ||
18 | for dirpath, dirnames, files in os.walk(path): | ||
19 | if len(files) != 0: | ||
20 | for f in files: | ||
21 | if f.endswith(".DNG") and "PXL_" not in f: | ||
22 | filename = dirpath + "/" + f | ||
23 | with exiftool.ExifToolHelper() as et: | ||
24 | for d in et.get_tags(filename, tags="EXIF:FocalLengthIn35mmFormat"): | ||
25 | count += 1 | ||
26 | print("{}: {} {}".format(count, filename, d["EXIF:FocalLengthIn35mmFormat"])) | ||
27 | focal_length[d["EXIF:FocalLengthIn35mmFormat"]] += 1 | ||
28 | pprint(focal_length) \ No newline at end of file | ||