From 8f091c883175aabc3ecf32451b6e39815c355940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Sat, 28 Jun 2025 07:23:54 +0200 Subject: [PATCH] shrinking photo inside frame now --- Fotobox.py | 3 +-- Photo.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Fotobox.py b/Fotobox.py index 52de741..6197bfc 100644 --- a/Fotobox.py +++ b/Fotobox.py @@ -150,8 +150,7 @@ class Fotobox: self._printer.qr(self._choice.urlWithProtocol, center=True, size=5) self._printer.text(url + "\n") self._printer.text("/p/" + self._choice.code + "\n") - self._printer.text(" \n") - self._printer.text(" \n") + self._printer.cut() self._printed = True except Exception as e: diff --git a/Photo.py b/Photo.py index bc58703..fafc73c 100644 --- a/Photo.py +++ b/Photo.py @@ -21,8 +21,9 @@ class Photo: def prepare(self, event: Event): self.framed_image = Image.new('RGB', (event.frame_photo_sized.width, event.frame_photo_sized.height)) - pos = ((self.framed_image.width - self.photo_image.width) // 2, (self.framed_image.height - self.photo_image.height) // 2) - self.framed_image.paste(self.photo_image, pos, self.photo_image.convert('RGBA')) + shrinked = shrink_inside(self.photo_image, event.frame_photo_sized.width, event.frame_photo_sized.height).convert('RGBA') + pos = ((self.framed_image.width - shrinked.width) // 2, (self.framed_image.height - shrinked.height) // 2) + self.framed_image.paste(shrinked, pos, shrinked) self.framed_image.paste(event.frame_photo_sized, (0, 0), event.frame_photo_sized) self.thumb_surface = pil_image_to_surface(shrink_inside(self.framed_image, THUMB_WIDTH, PHOTO_HEIGHT))