Summary
Mastodon includes the width and height properties in the ActivityPub representation of image attachments.
For example, the image in this toot is represented like this:
{
"type": "Document",
"mediaType": "image/png",
"url": "https://files.mastodon.social/media_attachments/files/116/614/866/422/305/225/original/00a9a8be3d4227b3.png",
"name": null,
"blurhash": "U56[viSc4Ut7?@bXV[oMM|t6t6Rk4oxbt7Rj",
"width": 3600,
"height": 1890
}
I'm proposing that Misskey does the same.
Purpose
Image attachments from Misskey posts don't have any size information in ActivityPub. Because of this, other ActivityPub software can have issues when laying out such posts in its client GUI.
For example, Smithereen uses a special algorithm that lays out post attachments in a nice grid (example). However, this algorithm requires that we know the aspect ratio of each image. If we don't know it, then it will lay out images as if they were squares. When actual images are fetched (and we know their sizes), they have to be layed out again. This results in worse user experience than it could be.
Do you want to implement this feature yourself?
Summary
Mastodon includes the
widthandheightproperties in the ActivityPub representation of image attachments.For example, the image in this toot is represented like this:
{ "type": "Document", "mediaType": "image/png", "url": "https://files.mastodon.social/media_attachments/files/116/614/866/422/305/225/original/00a9a8be3d4227b3.png", "name": null, "blurhash": "U56[viSc4Ut7?@bXV[oMM|t6t6Rk4oxbt7Rj", "width": 3600, "height": 1890 }I'm proposing that Misskey does the same.
Purpose
Image attachments from Misskey posts don't have any size information in ActivityPub. Because of this, other ActivityPub software can have issues when laying out such posts in its client GUI.
For example, Smithereen uses a special algorithm that lays out post attachments in a nice grid (example). However, this algorithm requires that we know the aspect ratio of each image. If we don't know it, then it will lay out images as if they were squares. When actual images are fetched (and we know their sizes), they have to be layed out again. This results in worse user experience than it could be.
Do you want to implement this feature yourself?