Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/app_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -1196,6 +1196,7 @@ def toggle_hidden_controls():
"AfPause",
"AfMetering",
"ScalerCrops",
"OutputWindows",
}

# Main widgets
Expand Down
8 changes: 6 additions & 2 deletions picamera2/picamera2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,10 +1272,14 @@ def configure_(self, camera_config):
self.preview_configuration.update(camera_config)

# Set the controls directly so as to overwrite whatever is there.
self.controls = Controls(self, controls=self.camera_config['controls'])
controls = self.camera_config['controls']
self.controls = Controls(self, controls=controls)
if isinstance(controls, Controls):
controls = controls.make_dict()
self.configure_count += 1

if "ScalerCrops" in self.camera_controls:
# We will supply reasonable default crops unless the user has done so themselves.
if "ScalerCrops" in self.camera_controls and "ScalerCrops" not in controls and "ScalerCrop" not in controls:
par_crop = self.camera_controls["ScalerCrops"]
full_fov = self.camera_controls["ScalerCrop"][1]
scaler_crops = [par_crop[0] if camera_config["main"]["preserve_ar"] else full_fov]
Expand Down
Loading