Skip to content

Commit

Permalink
main: only get resolution if its not undefined
Browse files Browse the repository at this point in the history
Signed-off-by: Bardia Moshiri <[email protected]>
  • Loading branch information
FakeShell committed Dec 23, 2023
1 parent 4f96621 commit 1566585
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,12 @@ ApplicationWindow {
} else {
camera.imageCapture.resolution = camera.firstFourThreeResolution
}

if (settings.cameras[camera.deviceId] && settings.cameras[camera.deviceId].resolution !== undefined) {
settings.cameras[camera.deviceId].resolution = Math.round(
(camera.imageCapture.supportedResolutions[0].width * camera.imageCapture.supportedResolutions[0].height) / 1000000
);
}
}

Camera {
Expand Down

0 comments on commit 1566585

Please sign in to comment.