From bc5ddf7d3a5cefd86df54d8a6d5ea31141e8727c Mon Sep 17 00:00:00 2001 From: hexbabe Date: Wed, 17 Jul 2024 09:19:25 -0400 Subject: [PATCH] Move resize mode check out of conditional --- .../src/depthai_sdk/components/camera_component.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/depthai_sdk/src/depthai_sdk/components/camera_component.py b/depthai_sdk/src/depthai_sdk/components/camera_component.py index c2e508622..498de1206 100644 --- a/depthai_sdk/src/depthai_sdk/components/camera_component.py +++ b/depthai_sdk/src/depthai_sdk/components/camera_component.py @@ -248,12 +248,14 @@ def config_camera(self, if self._replay: self._replay.resize(self._source, size_tuple, resize_mode) - elif self.is_color(): + + if resize_mode != ResizeMode.CROP: + raise ValueError("Currently only ResizeMode.CROP is supported mode for specifying size!") + + if self.is_color(): self.node.setStillSize(*size_tuple) self.node.setVideoSize(*size_tuple) self.node.setPreviewSize(*size_tuple) - if resize_mode != ResizeMode.CROP: - raise ValueError("Currently only ResizeMode.CROP is supported mode for specifying size!") else: crop_manip = self._pipeline.create(dai.node.ImageManip) crop_manip.initialConfig.setResize(*size_tuple)