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

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

@ -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",
"thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe", "info": {
"thumbnail_info": { "thumbnail_url": "mxc://localhost/FHyPlCeYUSFFxlgbQYZmoEoe",
"mimetype": "image/jpeg", "thumbnail_info": {
"size": 46144, "mimetype": "image/jpeg",
"w": 300, "size": 46144,
"h": 300 "w": 300,
"h": 300
}
}, },
"msgtype": "m.location" "msgtype": "m.location"
}, },
@ -17,4 +19,4 @@
"room_id": "!jEsUZKDJdhlrceRyVU:localhost", "room_id": "!jEsUZKDJdhlrceRyVU:localhost",
"type": "m.room.message", "type": "m.room.message",
"sender": "@example:localhost" "sender": "@example:localhost"
} }

@ -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
thumbnail_url: properties:
description: The URL to a thumbnail of the location being represented. thumbnail_url:
type: string 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: 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_info:
allOf:
- $ref: core-event-schema/msgtype_infos/image_info.yaml
title: ImageInfo
type: object
thumbnail_url: 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 type: string
w: thumbnail_info:
description: The width of the video in pixels. allOf:
type: integer - $ref: core-event-schema/msgtype_infos/thumbnail_info.yaml
description: Metadata about the image referred to in ``thumbnail_url``.
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…
Cancel
Save