fix(webp): finish extension centralization from pre-submission review

- build the video save-dialog filter from VIDEO_EXTENSIONS (_VIDEO_FILE_FILTER)
  instead of a hardcoded "Videos (*.mp4 *.mkv)" — the last filter that still
  drifted from the canonical set
- remove the now-dead file_types list (unused in both the fork and upstream;
  the PySide6 dialogs use the QFileDialog filter strings) and drop it from the
  centralization comment
This commit is contained in:
Tym Rabchuk
2026-06-23 19:30:07 -04:00
parent 9e1f0cc3a5
commit 47dffeb307
2 changed files with 5 additions and 7 deletions
+1 -6
View File
@@ -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
+4 -1
View File
@@ -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