PDF Layout: Make pretix logo a layout element, not a background element

This commit is contained in:
Raphael Michel
2018-07-10 13:24:27 +02:00
parent dc12b9a197
commit 6b9c3ad4e7
14 changed files with 343 additions and 35 deletions

View File

@@ -184,10 +184,15 @@ class BaseReportlabInvoiceRenderer(BaseInvoiceRenderer):
class ThumbnailingImageReader(ImageReader):
def resize(self, width, height, dpi):
if width is None:
width = height * self._image.size[0] / self._image.size[1]
if height is None:
height = width * self._image.size[1] / self._image.size[0]
self._image.thumbnail(
size=(int(width * dpi / 72), int(height * dpi / 72)),
resample=BICUBIC
)
return width, height
class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):