From 2fb428dfa79f71ae82279b85c90486efcb3eb1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 4 Mar 2026 10:53:25 +0100 Subject: [PATCH] Spec for MSC4230: Flag for animated images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .../examples/m.room.message$m.image.yaml | 3 ++- data/event-schemas/examples/m.sticker.yaml | 3 ++- .../core-event-schema/msgtype_infos/image_info.yaml | 13 +++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) 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..13c8bb15 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,18 @@ properties: allOf: - $ref: thumbnail_info.yaml description: Metadata about the image referred to in `thumbnail_url`. + is_animated: + 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