From 00deaff4fef373b8e29e3d7758686cbbd108c15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Fri, 27 Jun 2025 21:30:05 +0200 Subject: [PATCH] code clean --- Fotobox.py | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/Fotobox.py b/Fotobox.py index 56d77ec..ffcb2df 100644 --- a/Fotobox.py +++ b/Fotobox.py @@ -35,15 +35,15 @@ class Fotobox: camera.hflip = True camera.resolution = (2592, 1944) camera.rotation = 270 + camera.preview_configuration.main.size = res camera.preview_configuration.main.format = 'BGR888' camera.preview_configuration.transform = Transform(hflip=1, vflip=1) camera.configure("preview") - ##################### - # here configure still capture + self._capture_config = camera.create_still_configuration() camera.still_configuration.main.size = (2592, 1944) - ##################### + camera.start() self._camera = camera @@ -97,11 +97,6 @@ class Fotobox: image = Image.fromarray(frame) self._photos.append(Photo(self._shooting_timer.current(), image)) - #stream = io.BytesIO() - #self._camera.capture(stream, format='rgb') - #stream.seek(0) - #self._photos.append(Photo(self._shooting_timer.current(), Image.open(stream))) - screen.fill((0, 0, 0)) pygame.display.flip() @@ -211,10 +206,6 @@ class Fotobox: print(new_state) self._state = new_state if new_state == State.COUNTDOWN: - #config = self._camera.create_preview_configuration(main={"size": (PHOTO_WIDTH, PHOTO_HEIGHT)}) - #self._camera.configure(config) - #self._camera.start_preview() - #self._camera.start() self._countdown_timer.restart() elif new_state == State.SHOOTING: self._photos = [] @@ -223,7 +214,6 @@ class Fotobox: print("Starting shooting: S%04d-%s" % (self._shooting_number, iso(self._shooting_datetime))) self._shooting_timer.restart() elif new_state == State.PREPARE: - #self._camera.stop_preview() for photo in self._photos: photo.prepare(self._event) self._set_state(State.CHOOSE)