mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-10 11:59:59 -04:00
Fix /upload 500'ing when presented a very large image (#10029)
* Fix /upload 500'ing when presented a very large image Catch DecompressionBombError and re-raise as ThumbnailErrors * Set PIL's MAX_IMAGE_PIXELS to match homeserver.yaml to get it to bomb out quicker, to load less into memory in the case of super large images * Add changelog entry for 10029
This commit is contained in:
parent
21bd230831
commit
e8ac9ac8ca
3 changed files with 12 additions and 0 deletions
|
@ -76,6 +76,8 @@ class MediaRepository:
|
|||
self.max_upload_size = hs.config.max_upload_size
|
||||
self.max_image_pixels = hs.config.max_image_pixels
|
||||
|
||||
Thumbnailer.set_limits(self.max_image_pixels)
|
||||
|
||||
self.primary_base_path = hs.config.media_store_path # type: str
|
||||
self.filepaths = MediaFilePaths(self.primary_base_path) # type: MediaFilePaths
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue