diff options
author | Erik Johnston <erik@matrix.org> | 2017-03-20 17:25:41 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-03-20 17:25:41 +0000 |
commit | e0e214556a82370528ef1f9943773c42270c5336 (patch) | |
tree | 7fcbb016a63202eb1733e6b69a4999ba94193e8c /synapse/rest/media/v1 | |
parent | Merge pull request #2028 from majewsky/readme-fix-1 (diff) | |
parent | Bump changelog and version (diff) | |
download | synapse-e0e214556a82370528ef1f9943773c42270c5336.tar.xz |
Merge branch 'release-v0.19.3' of github.com:matrix-org/synapse v0.19.3
Diffstat (limited to 'synapse/rest/media/v1')
-rw-r--r-- | synapse/rest/media/v1/media_repository.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/media_repository.py b/synapse/rest/media/v1/media_repository.py index 3cbeca503c..481ffee200 100644 --- a/synapse/rest/media/v1/media_repository.py +++ b/synapse/rest/media/v1/media_repository.py @@ -240,6 +240,9 @@ class MediaRepository(object): if t_method == "crop": t_len = thumbnailer.crop(t_path, t_width, t_height, t_type) elif t_method == "scale": + t_width, t_height = thumbnailer.aspect(t_width, t_height) + t_width = min(m_width, t_width) + t_height = min(m_height, t_height) t_len = thumbnailer.scale(t_path, t_width, t_height, t_type) else: t_len = None |