diff options
author | clarkzjw <[email protected]> | 2024-04-27 18:18:31 -0700 |
---|---|---|
committer | clarkzjw <[email protected]> | 2024-04-27 18:18:31 -0700 |
commit | 23477dc11338f7b769c9fde95f73b18a9355c853 (patch) | |
tree | 9d911349af3a2239779c71570bc1cbc62ed63f44 | |
parent | 925be23c70fab3191ca82754ebd4b679de8d53a6 (diff) | |
download | Square-23477dc11338f7b769c9fde95f73b18a9355c853.tar.gz |
add ricoh focal length stats
-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 | ||