Merge pull request #723 from matrix-org/markjh/thumbnail_url

Move m.* thumbnail_url to be inside info to match m.video
pull/977/head
Richard van der Hoff 8 years ago committed by GitHub
commit aecac4f931

@ -3,12 +3,14 @@
"content": {
"body": "Big Ben, London, UK",
"geo_uri": "geo:51.5008,0.1247",
"thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe",
"thumbnail_info": {
"mimetype": "image/jpeg",
"size": 46144,
"w": 300,
"h": 300
"info": {
"thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe",
"thumbnail_info": {
"mimetype": "image/jpeg",
"size": 46144,
"w": 300,
"h": 300
}
},
"msgtype": "m.location"
},
@ -17,4 +19,4 @@
"room_id": "!jEsUZKDJdhlrceRyVU:localhost",
"type": "m.room.message",
"sender": "@example:localhost"
}
}

@ -4,13 +4,21 @@ 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
w:
description: The width of the image in pixels.
type: integer
thumbnail_url:
description: The URL to a thumbnail of the image.
type: string
thumbnail_info:
allOf:
- $ref: thumbnail_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
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:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
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:
description: The URL to the image.
type: string

@ -20,21 +20,19 @@ properties:
size:
description: The size of the file in bytes.
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
type: object
msgtype:
enum:
- m.file
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:
description: The URL to the file.
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'."
type: string
info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
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:
enum:
- m.image
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:
description: The URL to the image.
type: string

@ -15,14 +15,17 @@ properties:
enum:
- m.location
type: string
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
title: ImageInfo
info:
type: object
thumbnail_url:
description: The URL to a thumbnail of the location being represented.
type: string
properties:
thumbnail_url:
description: The URL to a thumbnail of the location being represented.
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:
- msgtype
- body

@ -17,23 +17,22 @@ properties:
h:
description: The height of the video in pixels.
type: integer
w:
description: The width of the video in pixels.
type: integer
mimetype:
description: The mimetype of the video e.g. ``video/mp4``.
type: string
size:
description: The size of the video in bytes.
type: integer
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
title: ImageInfo
type: object
thumbnail_url:
description: The URL to a thumbnail of the video clip.
description: The URL to an image thumbnail of the video clip.
type: string
w:
description: The width of the video in pixels.
type: integer
thumbnail_info:
allOf:
- $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
title: VideoInfo
type: object
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
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`_
Recommendations when sending messages

Loading…
Cancel
Save