diff --git a/modules/globals.py b/modules/globals.py index 0177f8e..2fbec38 100644 --- a/modules/globals.py +++ b/modules/globals.py @@ -6,7 +6,7 @@ from typing import List, Dict, Any ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) WORKFLOW_DIR = os.path.join(ROOT_DIR, "workflow") -# Canonical media extensions, defined once so file dialogs, file_types and +# Canonical media extensions, defined once so the file dialogs and # has_image_extension never drift. GIF is intentionally excluded: OpenCV's # cv2.imread/imwrite (the only image I/O this app uses) cannot decode or # encode GIF on 4.10 or 4.11, so offering it would silently fail. WEBP works @@ -14,11 +14,6 @@ WORKFLOW_DIR = os.path.join(ROOT_DIR, "workflow") IMAGE_EXTENSIONS = (".png", ".jpg", ".jpeg", ".bmp", ".webp") VIDEO_EXTENSIONS = (".mp4", ".mkv") -file_types = [ - ("Image", tuple(f"*{ext}" for ext in IMAGE_EXTENSIONS)), - ("Video", tuple(f"*{ext}" for ext in VIDEO_EXTENSIONS)), -] - # Face Mapping Data source_target_map: List[Dict[str, Any]] = [] # Stores detailed map for image/video processing simple_map: Dict[str, Any] = {} # Stores simplified map (embeddings/faces) for live/simple mode diff --git a/modules/ui.py b/modules/ui.py index 0cf37ad..d19993e 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -244,6 +244,9 @@ _IMAGE_FILE_FILTER = "Images (" + " ".join( _MEDIA_FILE_FILTER = "Media (" + " ".join( f"*{ext}" for ext in (*modules.globals.IMAGE_EXTENSIONS, *modules.globals.VIDEO_EXTENSIONS) ) + ")" +_VIDEO_FILE_FILTER = "Videos (" + " ".join( + f"*{ext}" for ext in modules.globals.VIDEO_EXTENSIONS +) + ")" # ─── image utilities ───────────────────────────────────────────────────── @@ -900,7 +903,7 @@ class MainWindow(QMainWindow): path, _f = QFileDialog.getSaveFileName( self, _("save video output file"), os.path.join(_RECENT_OUTPUT_DIR or "", "output.mp4"), - "Videos (*.mp4 *.mkv)", + _VIDEO_FILE_FILTER, ) else: return