diff --git a/Fotobox.py b/Fotobox.py index cfa3cc9..0645ddc 100644 --- a/Fotobox.py +++ b/Fotobox.py @@ -38,7 +38,6 @@ class Fotobox: camera.preview_configuration.main.size = res camera.preview_configuration.main.format = 'BGR888' - camera.preview_configuration.transform = Transform(hflip=1, vflip=1) camera.configure("preview") self._capture_config = camera.create_still_configuration() @@ -265,3 +264,9 @@ class Fotobox: upload.parent.mkdir(parents=True, exist_ok=True) os.link(path, upload) print("Photo saved: %s" % path.absolute()) + + + + + + diff --git a/Photo.py b/Photo.py index f27f018..bc58703 100644 --- a/Photo.py +++ b/Photo.py @@ -1,7 +1,7 @@ from PIL import Image from Event import Event, shrink_inside -from config import THUMB_WIDTH, pil_image_to_surface, SCREEN_RECT, BORDER, now, generate_code, HTTPS, DOMAIN, PHOTO_HEIGHT +from config import THUMB_WIDTH, pil_image_to_surface, SCREEN_RECT, BORDER, now, generate_code, HTTPS, DOMAIN, PHOTO_HEIGHT, WIDTH class Photo: @@ -29,7 +29,7 @@ class Photo: self.thumb_rect = self.thumb_surface.get_rect(centery=SCREEN_RECT.centery, left=(self.number - 1) * (THUMB_WIDTH + BORDER) + BORDER) self.chosen_surface = pil_image_to_surface(shrink_inside(self.framed_image, THUMB_WIDTH, PHOTO_HEIGHT)) - self.chosen_rect = self.thumb_surface.get_rect(centery=SCREEN_RECT.centery, left=(self.number - 1) * (THUMB_WIDTH + BORDER) + BORDER) + self.chosen_rect = self.chosen_surface.get_rect(right=WIDTH - 2 * BORDER, centery=SCREEN_RECT.centery) def _resize(self, width: float): height = width / self.photo_image.width * self.photo_image.height diff --git a/config.py b/config.py index 574ad2e..bac21ac 100644 --- a/config.py +++ b/config.py @@ -8,7 +8,7 @@ from pygame import Surface from pygame.time import Clock from qrcode.main import QRCode -DEBUG: bool = True +DEBUG: bool = False WIDTH: int = 800 HEIGHT: int = 480 diff --git a/rsync.sh b/rsync.sh old mode 100644 new mode 100755 index d8a8f73..9a8a248 --- a/rsync.sh +++ b/rsync.sh @@ -2,4 +2,7 @@ cd "$(dirname "$0")/data/photos/upload" || exit 1 -rsync -a ./* fotobox@mc.ph87.de:/srv/fotobox.online/html/p/ +while true; do + rsync -a -e 'ssh -p 2222' ./* mc@mc.ph87.de:/srv/fotobox.online/html/p/ + sleep 60 +done diff --git a/upload.sh b/upload.sh old mode 100644 new mode 100755