blob: a69742fef2ae8ae9101ee2b526fd82a6102c5405 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)
|