diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-12-11 14:19:32 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-12-11 14:19:32 +0000 |
commit | d80d505b1f70eae128990ce1a9517e5c5edead73 (patch) | |
tree | eeec77127889207fae0b44b5e95360cd953ee202 /synapse/config/repository.py | |
parent | doc the thumbnail methods (diff) | |
download | synapse-d80d505b1f70eae128990ce1a9517e5c5edead73.tar.xz |
Limit the size of images that are thumbnailed serverside. Limit the size of file that a server will download from a remote server
Diffstat (limited to 'synapse/config/repository.py')
-rw-r--r-- | synapse/config/repository.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/config/repository.py b/synapse/config/repository.py index 6eec930a03..f1b7b1b74e 100644 --- a/synapse/config/repository.py +++ b/synapse/config/repository.py @@ -20,6 +20,7 @@ class ContentRepositoryConfig(Config): def __init__(self, args): super(ContentRepositoryConfig, self).__init__(args) self.max_upload_size = self.parse_size(args.max_upload_size) + self.max_image_pixels = self.parse_size(args.max_image_pixels) self.media_store_path = self.ensure_directory(args.media_store_path) def parse_size(self, string): @@ -41,3 +42,7 @@ class ContentRepositoryConfig(Config): db_group.add_argument( "--media-store-path", default=cls.default_path("media_store") ) + db_group.add_argument( + "--max-image-pixels", default="32M", + help="Maximum number of pixels that will be thumbnailed" + ) |