Automattic / wordpress-activitypub

ActivityPub for WordPress
https://wordpress.org/plugins/activitypub/
MIT License
467 stars 67 forks source link

Feature Request: Default to Inline Images Instead of Attachments #737

Open DeadSuperHero opened 2 months ago

DeadSuperHero commented 2 months ago

What

Give admins the option to choose between making their images / media post attachments, or simply rendering them inline.

Why

Right now, our posts look somewhat strange: any post that includes an image is rendered as a status with an image attachment.

Here's an example of what I mean: https://mastodon.social/@news@wedistribute.org/112288557973314019

It ends up looking similar on Akkoma and other platforms, but at least we get the whole article. 😉

In the past, we tried setting the attachment value to 0, but then inline images didn't render. Maybe things have changed? 🤔

How

When rendering a post, it would be great to have an option to only render inline media.

pfefferle commented 2 months ago

This is a Mastodon issue! Mastodon does not support inline images. We do not change the HTML of a post before sending it via ActivityPub. It's totally up to the receiving platform how they handle/display the content!

pfefferle commented 2 months ago

Also: https://github.com/Automattic/wordpress-activitypub/issues/499

DeadSuperHero commented 2 months ago

The thing is, this still happens with posts as read by other systems.

Example of the same post on Akkoma: https://social.wedistribute.org/@news@wedistribute.org/posts/AgzVGb7AB1ZwhfjbNI

Rendered mostly fine in Friendica: https://libranet.de/display/0b0dde58-d1a377104572630f-3a60b489

Other platforms like Streams seem to do the same thing Akkoma does.

I guess what I'm really saying is this: it's not clear what the best practices are. If I set the Attachments value to 0, will the platforms capable of rendering inline images actually display images, just without attachments at the end? Or will there be no images?

pfefferle commented 2 months ago

I understand your point, but I would say this is still an issue of the receiver!?!

Reminds me about your post: https://deadsuperhero.com/2024/04/a-content-fallback-mechanism-for-the-fediverse/

As a publisher, the plugin provides as much information as possible so that the receiving platform can display the content optimally. It is not really practical to send different versions of content to different platforms, as the plugin can never know all platforms and cannot react immediately to changes on the remote site in terms of content handling.

I guess what I'm really saying is this: it's not clear what the best practices are. If I set the Attachments value to 0, will the platforms capable of rendering inline images actually display images, just without attachments at the end? Or will there be no images?

I think there is no easy answer to that, because it really depends on the remote platform. If you disable Attachments, you will not see any images on Mastodon, if you add them, you might have them as duplicates on Friendi.ca. Pixelfed seems to also strip inline images, so your post will not be listed at all if you disable Attachments.