#22 Fix rounding not happening

This commit is contained in:
James Hodgson
2022-10-07 17:24:29 +01:00
parent 264753259a
commit 1deabbb568
3 changed files with 8 additions and 12 deletions

View File

@@ -1,5 +1,4 @@
from picam.picam import PiCam
from utils.utils import round_resolution
from io import BytesIO
from picamera import PiCamera
@@ -23,17 +22,10 @@ class PiCam1(PiCam):
self.camera.resolution = resolution
def set_preview_resolution(self, resolution: "tuple[int, int]") -> None:
rounded_resolution = round_resolution(resolution, (32, 16))
super().set_preview_resolution(rounded_resolution)
super().set_preview_resolution(resolution)
self.set_camera_resolution(self.preview_resolution)
def set_capture_resolution(self, resolution: "tuple[int, int]") -> None:
rounded_resolution = round_resolution(resolution, (32, 16))
return super().set_capture_resolution(rounded_resolution)
def init_camera(self) -> None:
"""Initialize picamera camera object"""
self.camera = PiCamera(resolution=self.preview_resolution)