From 252de984ccef08104828077736e63a1a265e2d6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= <76261501+zecakeh@users.noreply.github.com> Date: Tue, 10 Mar 2026 19:54:05 +0100 Subject: [PATCH] Spec for MSC4230: Flag for animated images (#2328) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Spec for MSC4230: Flag for animated images Signed-off-by: Kévin Commaille * Add changelog Signed-off-by: Kévin Commaille * Add x-addedInMatrixVersion property Signed-off-by: Kévin Commaille --------- Signed-off-by: Kévin Commaille --- .../client_server/newsfragments/2328.feature | 1 + .../examples/m.room.message$m.image.yaml | 3 ++- data/event-schemas/examples/m.sticker.yaml | 3 ++- .../msgtype_infos/image_info.yaml | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 changelogs/client_server/newsfragments/2328.feature diff --git a/changelogs/client_server/newsfragments/2328.feature b/changelogs/client_server/newsfragments/2328.feature new file mode 100644 index 00000000..3f544309 --- /dev/null +++ b/changelogs/client_server/newsfragments/2328.feature @@ -0,0 +1 @@ +Add the `is_animated` flag to the `info` object of the `m.image` msgtype and the `m.sticker` event, as per [MSC4230](https://github.com/matrix-org/matrix-spec-proposals/pull/423O). diff --git a/data/event-schemas/examples/m.room.message$m.image.yaml b/data/event-schemas/examples/m.room.message$m.image.yaml index a0e38c82..3a9cd0bc 100644 --- a/data/event-schemas/examples/m.room.message$m.image.yaml +++ b/data/event-schemas/examples/m.room.message$m.image.yaml @@ -7,7 +7,8 @@ "h": 398, "w": 394, "mimetype": "image/jpeg", - "size": 31037 + "size": 31037, + "is_animated": false }, "url": "mxc://example.org/JWEIFJgwEIhweiWJE", "msgtype": "m.image" diff --git a/data/event-schemas/examples/m.sticker.yaml b/data/event-schemas/examples/m.sticker.yaml index 971cdc90..c06d8c08 100644 --- a/data/event-schemas/examples/m.sticker.yaml +++ b/data/event-schemas/examples/m.sticker.yaml @@ -9,7 +9,8 @@ "mimetype": "image/png", "h": 200, "w": 140, - "size": 73602 + "size": 73602, + "is_animated": true }, "h": 200, "thumbnail_url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP", diff --git a/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml b/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml index 4460cdee..90a3331c 100644 --- a/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml +++ b/data/event-schemas/schema/core-event-schema/msgtype_infos/image_info.yaml @@ -34,5 +34,19 @@ properties: allOf: - $ref: thumbnail_info.yaml description: Metadata about the image referred to in `thumbnail_url`. + is_animated: + x-addedInMatrixVersion: "1.18" + description: |- + If this flag is `true`, the original image SHOULD be assumed to be + animated. If this flag is `false`, the original image SHOULD be assumed to + NOT be animated. + + If a sending client is unable to determine whether an image is animated, + it SHOULD leave the flag unset. + + Receiving clients MAY use this flag to optimize whether to download the + original image rather than a thumbnail if it is animated, but they SHOULD + NOT trust this flag. + type: boolean title: ImageInfo type: object