Merge pull request #723 from matrix-org/markjh/thumbnail_url
Move m.* thumbnail_url to be inside info to match m.video
This commit is contained in:
commit
aecac4f931
9 changed files with 70 additions and 70 deletions
|
@ -3,12 +3,14 @@
|
||||||
"content": {
|
"content": {
|
||||||
"body": "Big Ben, London, UK",
|
"body": "Big Ben, London, UK",
|
||||||
"geo_uri": "geo:51.5008,0.1247",
|
"geo_uri": "geo:51.5008,0.1247",
|
||||||
|
"info": {
|
||||||
"thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe",
|
"thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe",
|
||||||
"thumbnail_info": {
|
"thumbnail_info": {
|
||||||
"mimetype": "image/jpeg",
|
"mimetype": "image/jpeg",
|
||||||
"size": 46144,
|
"size": 46144,
|
||||||
"w": 300,
|
"w": 300,
|
||||||
"h": 300
|
"h": 300
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"msgtype": "m.location"
|
"msgtype": "m.location"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,13 +4,21 @@ properties:
|
||||||
h:
|
h:
|
||||||
description: The height of the image in pixels.
|
description: The height of the image in pixels.
|
||||||
type: integer
|
type: integer
|
||||||
|
w:
|
||||||
|
description: The width of the image in pixels.
|
||||||
|
type: integer
|
||||||
mimetype:
|
mimetype:
|
||||||
description: The mimetype of the image, e.g. ``image/jpeg``.
|
description: The mimetype of the image, e.g. ``image/jpeg``.
|
||||||
type: string
|
type: string
|
||||||
size:
|
size:
|
||||||
description: Size of the image in bytes.
|
description: Size of the image in bytes.
|
||||||
type: integer
|
type: integer
|
||||||
w:
|
thumbnail_url:
|
||||||
description: The width of the image in pixels.
|
description: The URL to a thumbnail of the image.
|
||||||
type: integer
|
type: string
|
||||||
|
thumbnail_info:
|
||||||
|
allOf:
|
||||||
|
- $ref: thumbnail_info.yaml
|
||||||
|
description: Metadata about the image referred to in ``thumbnail_url``.
|
||||||
title: ImageInfo
|
title: ImageInfo
|
||||||
|
type: object
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
$schema: http://json-schema.org/draft-04/schema#
|
||||||
|
description: Metadata about a thumbnail image.
|
||||||
|
properties:
|
||||||
|
h:
|
||||||
|
description: The height of the image in pixels.
|
||||||
|
type: integer
|
||||||
|
w:
|
||||||
|
description: The width of the image in pixels.
|
||||||
|
type: integer
|
||||||
|
mimetype:
|
||||||
|
description: The mimetype of the image, e.g. ``image/jpeg``.
|
||||||
|
type: string
|
||||||
|
size:
|
||||||
|
description: Size of the image in bytes.
|
||||||
|
type: integer
|
||||||
|
title: ThumbnailInfo
|
||||||
|
type: object
|
|
@ -9,17 +9,6 @@ properties:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
||||||
description: Metadata about the image referred to in ``url``.
|
description: Metadata about the image referred to in ``url``.
|
||||||
title: ImageInfo
|
|
||||||
type: object
|
|
||||||
thumbnail_info:
|
|
||||||
allOf:
|
|
||||||
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
|
||||||
description: Metadata about the image referred to in ``thumbnail_url``.
|
|
||||||
title: ImageInfo
|
|
||||||
type: object
|
|
||||||
thumbnail_url:
|
|
||||||
description: The URL to the thumbnail of the image.
|
|
||||||
type: string
|
|
||||||
url:
|
url:
|
||||||
description: The URL to the image.
|
description: The URL to the image.
|
||||||
type: string
|
type: string
|
||||||
|
|
|
@ -20,21 +20,19 @@ properties:
|
||||||
size:
|
size:
|
||||||
description: The size of the file in bytes.
|
description: The size of the file in bytes.
|
||||||
type: integer
|
type: integer
|
||||||
|
thumbnail_url:
|
||||||
|
description: The URL to the thumbnail of the file.
|
||||||
|
type: string
|
||||||
|
thumbnail_info:
|
||||||
|
allOf:
|
||||||
|
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
|
||||||
|
description: Metadata about the image referred to in ``thumbnail_url``.
|
||||||
title: FileInfo
|
title: FileInfo
|
||||||
type: object
|
type: object
|
||||||
msgtype:
|
msgtype:
|
||||||
enum:
|
enum:
|
||||||
- m.file
|
- m.file
|
||||||
type: string
|
type: string
|
||||||
thumbnail_info:
|
|
||||||
allOf:
|
|
||||||
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
|
||||||
description: Metadata about the image referred to in ``thumbnail_url``.
|
|
||||||
title: ImageInfo
|
|
||||||
type: object
|
|
||||||
thumbnail_url:
|
|
||||||
description: The URL to the thumbnail of the file.
|
|
||||||
type: string
|
|
||||||
url:
|
url:
|
||||||
description: The URL to the file.
|
description: The URL to the file.
|
||||||
type: string
|
type: string
|
||||||
|
|
|
@ -9,35 +9,13 @@ properties:
|
||||||
description: "A textual representation of the image. This could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. 'image attachment'."
|
description: "A textual representation of the image. This could be the alt text of the image, the filename of the image, or some kind of content description for accessibility e.g. 'image attachment'."
|
||||||
type: string
|
type: string
|
||||||
info:
|
info:
|
||||||
|
allOf:
|
||||||
|
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
||||||
description: Metadata about the image referred to in ``url``.
|
description: Metadata about the image referred to in ``url``.
|
||||||
properties:
|
|
||||||
h:
|
|
||||||
description: The height of the image in pixels.
|
|
||||||
type: integer
|
|
||||||
mimetype:
|
|
||||||
description: 'The mimetype of the image, e.g. ``image/jpeg``.'
|
|
||||||
type: string
|
|
||||||
size:
|
|
||||||
description: Size of the image in bytes.
|
|
||||||
type: integer
|
|
||||||
w:
|
|
||||||
description: The width of the image in pixels.
|
|
||||||
type: integer
|
|
||||||
title: ImageInfo
|
|
||||||
type: object
|
|
||||||
msgtype:
|
msgtype:
|
||||||
enum:
|
enum:
|
||||||
- m.image
|
- m.image
|
||||||
type: string
|
type: string
|
||||||
thumbnail_info:
|
|
||||||
allOf:
|
|
||||||
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
|
||||||
description: Metadata about the image referred to in ``thumbnail_url``.
|
|
||||||
title: ImageInfo
|
|
||||||
type: object
|
|
||||||
thumbnail_url:
|
|
||||||
description: The URL to the thumbnail of the image.
|
|
||||||
type: string
|
|
||||||
url:
|
url:
|
||||||
description: The URL to the image.
|
description: The URL to the image.
|
||||||
type: string
|
type: string
|
||||||
|
|
|
@ -15,14 +15,17 @@ properties:
|
||||||
enum:
|
enum:
|
||||||
- m.location
|
- m.location
|
||||||
type: string
|
type: string
|
||||||
thumbnail_info:
|
info:
|
||||||
allOf:
|
|
||||||
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
|
||||||
title: ImageInfo
|
|
||||||
type: object
|
type: object
|
||||||
|
properties:
|
||||||
thumbnail_url:
|
thumbnail_url:
|
||||||
description: The URL to a thumbnail of the location being represented.
|
description: The URL to a thumbnail of the location being represented.
|
||||||
type: string
|
type: string
|
||||||
|
thumbnail_info:
|
||||||
|
allOf:
|
||||||
|
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
|
||||||
|
description: Metadata about the image referred to in ``thumbnail_url``.
|
||||||
|
title: LocationInfo
|
||||||
required:
|
required:
|
||||||
- msgtype
|
- msgtype
|
||||||
- body
|
- body
|
||||||
|
|
|
@ -17,23 +17,22 @@ properties:
|
||||||
h:
|
h:
|
||||||
description: The height of the video in pixels.
|
description: The height of the video in pixels.
|
||||||
type: integer
|
type: integer
|
||||||
|
w:
|
||||||
|
description: The width of the video in pixels.
|
||||||
|
type: integer
|
||||||
mimetype:
|
mimetype:
|
||||||
description: The mimetype of the video e.g. ``video/mp4``.
|
description: The mimetype of the video e.g. ``video/mp4``.
|
||||||
type: string
|
type: string
|
||||||
size:
|
size:
|
||||||
description: The size of the video in bytes.
|
description: The size of the video in bytes.
|
||||||
type: integer
|
type: integer
|
||||||
|
thumbnail_url:
|
||||||
|
description: The URL to an image thumbnail of the video clip.
|
||||||
|
type: string
|
||||||
thumbnail_info:
|
thumbnail_info:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: core-event-schema/msgtype_infos/image_info.yaml
|
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
|
||||||
title: ImageInfo
|
description: Metadata about the image referred to in ``thumbnail_url``.
|
||||||
type: object
|
|
||||||
thumbnail_url:
|
|
||||||
description: The URL to a thumbnail of the video clip.
|
|
||||||
type: string
|
|
||||||
w:
|
|
||||||
description: The width of the video in pixels.
|
|
||||||
type: integer
|
|
||||||
title: VideoInfo
|
title: VideoInfo
|
||||||
type: object
|
type: object
|
||||||
msgtype:
|
msgtype:
|
||||||
|
|
|
@ -71,6 +71,12 @@ Events which have attachments (e.g. ``m.image``, ``m.file``) SHOULD be
|
||||||
uploaded using the `content repository module`_ where available. The
|
uploaded using the `content repository module`_ where available. The
|
||||||
resulting ``mxc://`` URI can then be used in the ``url`` key.
|
resulting ``mxc://`` URI can then be used in the ``url`` key.
|
||||||
|
|
||||||
|
Clients MAY include a client generated thumbnail image for an attachment under
|
||||||
|
a ``info.thumbnail_url`` key. The thumbnail SHOULD also be a ``mxc://`` URI.
|
||||||
|
Clients displaying events with attachments can either use the client generated
|
||||||
|
thumbnail or ask its homeserver to generate a thumbnail from the original
|
||||||
|
attachment using the `content repository module`_.
|
||||||
|
|
||||||
.. _`content repository module`: `module:content`_
|
.. _`content repository module`: `module:content`_
|
||||||
|
|
||||||
Recommendations when sending messages
|
Recommendations when sending messages
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue