mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
Merge pull request #1945 from jkolo/fix_dynamic_thumbnails_aspect
Fix #1677 (dynamic thumbnails aspect)
This commit is contained in:
commit
acf6d4d2e3
1 changed files with 3 additions and 0 deletions
|
@ -240,6 +240,9 @@ class MediaRepository(object):
|
||||||
if t_method == "crop":
|
if t_method == "crop":
|
||||||
t_len = thumbnailer.crop(t_path, t_width, t_height, t_type)
|
t_len = thumbnailer.crop(t_path, t_width, t_height, t_type)
|
||||||
elif t_method == "scale":
|
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)
|
t_len = thumbnailer.scale(t_path, t_width, t_height, t_type)
|
||||||
else:
|
else:
|
||||||
t_len = None
|
t_len = None
|
||||||
|
|
Loading…
Reference in a new issue