Skip to content

Add info for matrix image messages#2

Merged
antonizoon merged 1 commit intobibanon:masterfrom
c-holtermann:matrix-image-message-info
Jun 2, 2025
Merged

Add info for matrix image messages#2
antonizoon merged 1 commit intobibanon:masterfrom
c-holtermann:matrix-image-message-info

Conversation

@antonizoon
Copy link
Member

From 42wim#2228 by c-holtermann

This pull request adds image info (mtype, width, height) to the matrix message. It uses b.mc.SendMessageEvent instead of b.mc.SendImage to include the info part.

Images sent to matrix get shown in element but when using mautrix (signal) bridge to further forward the image it does not get recognized as image but is being treated as file.

Fileinfo is optional (https://spec.matrix.org/v1.14/client-server-api/#mimage).

There are different options dealing with metainfo:

a) forward if present in received message
b) (re)generate when sending
c) (or in my case make the next bridge accept images without metainfo)

To properly display images in signal mautrix signal could be changed to accept image messages without imageinfo (c), or gomatrix could include this (b1) (archived repo: https://github.com/matrix-org/gomatrix so no changes to be expected here) or it can be implemented here (b2). I decided to go for the latter. It works for me.

I am dealing with messages from telegram bridged to matrix. The telegram message includes the width and height. It would even be possible to forward this metainformation through matterbridge (a) but I did not see an easy way to accomplish this.

@antonizoon antonizoon merged commit 3f0a1ac into bibanon:master Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants