From a04f399b0ba5ebc3dcf19c2bf800b958a86b4b8b Mon Sep 17 00:00:00 2001 From: leccelecce <24962424+leccelecce@users.noreply.github.com> Date: Wed, 18 Mar 2026 12:08:54 +0000 Subject: [PATCH] Remove unnecessary grayscale helper --- frigate/util/file.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/frigate/util/file.py b/frigate/util/file.py index a6cdefee1..8f28c5504 100644 --- a/frigate/util/file.py +++ b/frigate/util/file.py @@ -37,20 +37,6 @@ def get_event_snapshot(event: Event) -> ndarray | None: return image -def _load_snapshot_image(image_path: str) -> ndarray | None: - image = cv2.imread(image_path, cv2.IMREAD_UNCHANGED) - if image is None: - return None - - if len(image.shape) == 2: - return cv2.cvtColor(image, cv2.COLOR_GRAY2BGR) - - if len(image.shape) == 3 and image.shape[2] == 4: - return cv2.cvtColor(image, cv2.COLOR_BGRA2BGR) - - return image - - def _event_snapshot_is_clean(event: Event) -> bool: return bool(event.data and event.data.get("snapshot_clean")) @@ -87,7 +73,7 @@ def load_event_snapshot_image( if image_path is None: return None, False - image = _load_snapshot_image(image_path) + image = cv2.imread(image_path) if image is None: logger.warning("Unable to load snapshot from %s", image_path) return None, False