Fix handling of metadata

This commit is contained in:
Alexander Wainwright
2025-04-13 15:17:40 +10:00
parent 876c67e04e
commit 6d583c5b14

View File

@@ -37,8 +37,14 @@ def extract_metadata(image_path: Path):
meta = img.read_exif()
xmp = img.read_xmp()
make = meta.get('Exif.Image.Make', None)
camera = meta.get('Exif.Image.Model', None)
film = xmp['Xmp.dc.description']['lang="x-default"']
if make not in camera:
camera = make + ' ' + camera
try:
film = xmp['Xmp.dc.description']['lang="x-default"']
except Exception:
film = None
return camera, film
except Exception: