Commit 55eb6177 authored by Morgan McMillian's avatar Morgan McMillian

- assume defaults for image that does not contain height or width

issue #41
parent dbf3d5e1
......@@ -201,8 +201,14 @@ def raw_from_event(event):
value['url'] = url
value['title'] = event['content']['body']
if 'info' in event['content']:
value['width'] = event['content']['info']['w']
value['height'] = event['content']['info']['h']
if 'w' in event['content']['info']:
value['width'] = event['content']['info']['w']
else:
value['width'] = 200
if 'h' in event['content']['info']:
value['height'] = event['content']['info']['h']
else:
value['height'] = 200
if 'thumbnail_info' in event['content']['info']:
value['thumbnail_url'] = app.config['MATRIX_HOST'] + '/_matrix/media/r0/download/' + event['content']['info']['thumbnail_url'][6:]
value['thumbnail_width'] = event['content']['info']['thumbnail_info']['w']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment