mirror of
https://github.com/pretix/pretix.git
synced 2026-05-09 15:54:03 +00:00
Prevent huge invoice files if a JPEG logo is used
This commit is contained in:
@@ -192,8 +192,15 @@ class ThumbnailingImageReader(ImageReader):
|
|||||||
size=(int(width * dpi / 72), int(height * dpi / 72)),
|
size=(int(width * dpi / 72), int(height * dpi / 72)),
|
||||||
resample=BICUBIC
|
resample=BICUBIC
|
||||||
)
|
)
|
||||||
|
self._data = None
|
||||||
return width, height
|
return width, height
|
||||||
|
|
||||||
|
def _jpeg_fh(self):
|
||||||
|
# Bypass a reportlab-internal optimization that falls back to the original
|
||||||
|
# file handle if the file is a JPEG, and therefore does not respect the
|
||||||
|
# (smaller) size of the modified image.
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
|
class ClassicInvoiceRenderer(BaseReportlabInvoiceRenderer):
|
||||||
identifier = 'classic'
|
identifier = 'classic'
|
||||||
|
|||||||
Reference in New Issue
Block a user