summary refs log tree commit diff
path: root/synapse/rest/media
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2016-04-03 23:57:05 +0100
committerMatthew Hodgson <matthew@matrix.org>2016-04-03 23:57:05 +0100
commitcf51c4120e79a59a798fcf88c5c7d9f95dc6e76d (patch)
tree04388da1e91577fa0eb60244152b579fee838d3a /synapse/rest/media
parentchar encoding (diff)
downloadsynapse-cf51c4120e79a59a798fcf88c5c7d9f95dc6e76d.tar.xz
report image size (bytewise) in OG meta
Diffstat (limited to 'synapse/rest/media')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py
index ff522c5fb8..f5ec32d8f2 100644
--- a/synapse/rest/media/v1/preview_url_resource.py
+++ b/synapse/rest/media/v1/preview_url_resource.py
@@ -131,6 +131,7 @@ class PreviewUrlResource(BaseMediaResource):
                         self.server_name, media_info['filesystem_id']
                     ),
                     "og:image:type": media_info['media_type'],
+                    "matrix:image:size": media_info['media_length'],
                 }
 
                 if dims:
@@ -269,6 +270,7 @@ class PreviewUrlResource(BaseMediaResource):
                     self.server_name, image_info['filesystem_id']
                 )
                 og["og:image:type"] = image_info['media_type']
+                og["matrix:image:size"] = image_info['media_length']
             else:
                 del og["og:image"]