Fix Open Graph/oEmbed data to contain post image #332

Closed
opened 2023-01-29 15:59:21 +00:00 by dhalucario · 4 comments

Hi, I have been using misskey/foundkey for quite a while now and have an issue with the previews. Every time I share a link to a post which has an image attachment, I don't see the post image in the preview.

image
image

I propose the following fix:

  • A post with an image attachment should use the image in preview.
  • If the post image is hidden by a content warning, it should be hidden from the preview.

Optionally:

  • A setting to disable image attachment previews completely.
  • A setting to enable image attachment previews on posts with a content warning.
Hi, I have been using misskey/foundkey for quite a while now and have an issue with the previews. Every time I share a link to a post which has an image attachment, I don't see the post image in the preview. ![image](/attachments/01baced5-1be8-4b5d-85ef-8f52183d2091) ![image](/attachments/6fedf317-2332-45a5-bddd-77df12432a79) I propose the following fix: * A post with an image attachment should use the image in preview. * If the post image is hidden by a content warning, it should be hidden from the preview. Optionally: * A setting to disable image attachment previews completely. * A setting to enable image attachment previews on posts with a content warning.
dhalucario changed title from Fix Open Graph/oEmbed data to contain post image. to Fix Open Graph/oEmbed data to contain post image 2023-01-29 16:02:09 +00:00
Owner

This still leaves me with some open questions:

  1. I think it would be appropriate to also hide the image if the entire post has a content warning.
  2. What to do if there are multiple images?
    1. What to do if some of these multiple images are marked sensitive.
  3. Continue showing the profile picture if there are no attached images?

I think regarding making it configurable it is probably more complex than would be worth.

This still leaves me with some open questions: 1. I think it would be appropriate to also hide the image if the entire post has a content warning. 2. What to do if there are multiple images? 1. What to do if some of these multiple images are marked sensitive. 3. Continue showing the profile picture if there are no attached images? I think regarding making it configurable it is probably more complex than would be worth.
Author

This still leaves me with some open questions:

  1. I think it would be appropriate to also hide the image if the entire post has a content warning.
  2. What to do if there are multiple images?
    1. What to do if some of these multiple images are marked sensitive.
  3. Continue showing the profile picture if there are no attached images?

I think regarding making it configurable it is probably more complex than would be worth.

  1. I agree.
  2. Open Graph allows you to add multiple og:image meta tags. I need to double check if Discord and Telegram support this properly.
  3. Yeah that sounds like a good plan.

Edit: It seems like when there is multiple og:image's Telegram uses the last one and Discord uses the first one.

> This still leaves me with some open questions: > > 1. I think it would be appropriate to also hide the image if the entire post has a content warning. > 2. What to do if there are multiple images? > 1. What to do if some of these multiple images are marked sensitive. > 3. Continue showing the profile picture if there are no attached images? > > I think regarding making it configurable it is probably more complex than would be worth. 1. I agree. 2. Open Graph allows you to add multiple `og:image` meta tags. I need to double check if Discord and Telegram support this properly. 3. Yeah that sounds like a good plan. Edit: It seems like when there is multiple `og:image`'s Telegram uses the last one and Discord uses the first one.
Owner

So with the edited in comment, I'm not sure if it is a good idea to add multiple tags.

Also since you didnt answer 2.1 I'm inclined to also continue showing the profile picture if there are any sensitive files attached.

So with the edited in comment, I'm not sure if it is a good idea to add multiple tags. Also since you didnt answer 2.1 I'm inclined to also continue showing the profile picture if there are *any* sensitive files attached.
Owner

With commit 39fb7e5946, the OpenGraph data should be improved.

I have decided against using the users profile picture in any case as I think it does not really match the definition of the field:

og:image - An image URL which should represent your object within the graph.
-- https://ogp.me/

I think only the user themself should be represented with their profile picture.

I have also fixed some other issues with our OpenGraph data such as proclaiming all files to be images and we now also provide some more metadata about the files such as MIME type and image alt texts (if provided).

With commit 39fb7e594624957ec2e0f15ec2ec6332901587af, the OpenGraph data should be improved. I have decided against using the users profile picture in any case as I think it does not really match the definition of the field: > `og:image` - An image URL which should represent your object within the graph. -- https://ogp.me/ I think only the user themself should be represented with their profile picture. I have also fixed some other issues with our OpenGraph data such as proclaiming all files to be images and we now also provide some more metadata about the files such as MIME type and image alt texts (if provided).
Sign in to join this conversation.
No labels
feature
fix
upkeep
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#332
No description provided.