FEP-1311: Media Attachments

This is the discussion topic for

Media Attachments are ubiquitous in the Fediverse. My quick investigation into the explore tab on mastodon.social yields that about half the posts contain an image attachment. The mechanism for these is poorly documented. For example, it is not mentioned in ActivityPub.

My goal in this FEP is to document current usage, and issue recommendations on how to improve it. These recommendations are based on the support table Recommended Media Attachment Format available at FunFedi.dev.

For developers that enjoy making their keyboards smoke, I believe that the above link combined with the content of Testing should be enough to adapt their Fediverse applications. The other parts are meant for people, who which to improve the situation related to media attachments.

Todos

  • Add “How to embed media into an Article” as an open question. Using an <img> tag is obviously not enough, because you are referring an attachment and not a web resource. This in particular means that Article should not be used until this issue is resolved.
  • Address how this is extensible, e.g. one can add properties to the media objects. One can add different things to attachments, e.g. a link.
  • Discuss updating the url
3 Likes

An erratum has been proposed that moves the width and height to the url property in AS example: Erratum for Example 79 to correct `width` and `height` properties by evanp · Pull Request #630 · w3c/activitystreams · GitHub

I’m very ambivalent on this pull requests:

  • :+1: Yes! It makes ActivityStreams more self consistent.
  • :-1: No!!! This moves ActivityStreams further away from describing the Fediverse and actually suggests something that will be incompatible with current implementations.

https://data.funfedi.dev/0.1.12/mastodon__v4.3.2/image_attachments/#example-13

shows that Mastodon doesn’t even parse an object containing the now suggested format.

One can find more details on

If someone involved with the SocialCG would like to have a work item to do better on, this would be a good one. There’s unfortunately not a discourse group for me to tag.

1 Like

This is a good idea as a FEP, but currently every UGC attachment in the fediverse is almost always distributed as a Document, here’s some data from an early preview of @darius’s wonderful Fediverse Observatory project

As you can see, Image is very rarely used, Document is primarily used.

Add “How to embed media into an Article” as an open question. Using an <img> tag is obviously not enough, because you are referring an attachment and not a web resource.

If the attachment has a name, you could specify the embedded attachment with a local tag, like: <img src="#the image name">.

Alternatively, since each image has an url, you could use that (exact) url, and let clients match the image sources to urls in the attachments.

1 Like

The open question is not how to possibly implement this, but to define a standard accepted by the Fediverse. This means that a sufficient number of implementations support it.

As eloquently stated by @jenniferplusplus here

It only takes 2 or 3 projects to agree to a standard

Of course to convince me the projects should be in this table.

@helge

>Binary Fediverse transport

What do you think about data: URIs? They can be used today, no changes to wire format are needed.

@feps

I’ll have an answer, once I get around to

This way my opinion will be backed up by evidence.

I think some use cases are very much good for data uris. profile pictures or emojis come to mind.

1 Like