metadata writer: add guard for exiftools installed on system level
Tests / test_and_lint (push) Successful in 27s

This commit is contained in:
2026-10-06 08:10:23 +02:00
parent 7c77eeb392
commit afc90a9f28
+8
View File
@@ -1,4 +1,5 @@
import logging
import shutil
from pathlib import Path
from typing import Annotated, Any
@@ -9,6 +10,13 @@ from photools3.settings import settings
log = logging.getLogger(__name__)
_EXIFTOOL_MISSING_MSG = (
"exiftool binary not found in PATH. "
"Install the system package: 'perl-image-exiftool' (Arch) or 'libimage-exiftool-perl' (Debian/Ubuntu)."
)
if shutil.which("exiftool") is None:
raise FileNotFoundError(_EXIFTOOL_MISSING_MSG)
# File extensions that should use XMP sidecars
SIDECAR_EXTENSIONS = {".dng", ".nef", ".cr2", ".cr3", ".arw", ".raf", ".orf", ".rw2"}