- assume defaults for image that does not contain height or width
issue #41
This commit is contained in:
parent
dbf3d5e1ae
commit
55eb6177fe
1 changed files with 8 additions and 2 deletions
|
@ -201,8 +201,14 @@ def raw_from_event(event):
|
|||
value['url'] = url
|
||||
value['title'] = event['content']['body']
|
||||
if 'info' in event['content']:
|
||||
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']
|
||||
|
|
Loading…
Reference in a new issue