Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide thumbnail with RSS #581

Closed
eskan opened this issue Mar 6, 2020 · 12 comments · Fixed by #4413
Closed

Provide thumbnail with RSS #581

eskan opened this issue Mar 6, 2020 · 12 comments · Fixed by #4413
Labels
area: rss enhancement New feature or request extra: good first issue Good for newcomers extra: help wanted Extra attention is needed

Comments

@eskan
Copy link

eskan commented Mar 6, 2020

Hi,
the RSS feed should provide a url for image or thumbnail.
regards,


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@dessalines
Copy link
Member

dessalines commented Mar 6, 2020

I guess just the sites favicon? https://dev.lemmy.ml/static/assets/favicon.svg

Can RSS feeds have svg thumbnails? If not there's an apple-touch-icon one.

@Nutomic
Copy link
Member

Nutomic commented Mar 6, 2020

Pretty sure the issue is about including thumbnails for posts in the RSS feed. Apparently we forgot to add that in the initial implementation.

@Nutomic Nutomic added enhancement New feature or request Component: Backend labels Mar 6, 2020
@dessalines
Copy link
Member

The thumbnails (unless its an image post) aren't stored on the back-end yet. This will have to wait for #558 .

@Nutomic
Copy link
Member

Nutomic commented Mar 6, 2020

We could also just include the full-size images.

@dessalines
Copy link
Member

The pictshare_urls are full size, but the back end currently doesn't store any images, only the url field.

@eskan
Copy link
Author

eskan commented Mar 6, 2020

the url field should be perfect, here a rss reference :
https://www.w3schools.com/xml/xml_rss.asp#rssref
is enclosure is the best way to reference an image ?
https://www.w3schools.com/xml/rss_tag_enclosure.asp

@dessalines
Copy link
Member

dessalines commented Mar 8, 2020

@Nutomic There are now thumbnails in the post fetch, the thumbnail_url column.

@Nutomic
Copy link
Member

Nutomic commented Mar 28, 2020

I might be missing something here, but it looks like the rss crate does not support images for feed items, only for channels. Maybe there is a workaround with extensions or something, but I'm not sure.

https://rust-syndication.github.io/rss/rss/struct.Channel.html#method.image
https://rust-syndication.github.io/rss/rss/struct.Item.html

Edit: Forget that, we just need to put it in the html.

@dessalines
Copy link
Member

dessalines commented Mar 28, 2020

Unfortunately stackoverflow is debating on it, but it looks like it needs to be an enclosure:

https://rust-syndication.github.io/rss/rss/struct.Enclosure.html

Basically if the pictshare_thumbnail column exists, we set an image enclosure for the item. @Nutomic u want this or should I do?

@Nutomic
Copy link
Member

Nutomic commented Mar 28, 2020

I dont really care, but anyway its really low priority.

@dessalines dessalines added the extra: help wanted Extra attention is needed label May 29, 2020
@Nutomic
Copy link
Member

Nutomic commented Nov 20, 2020

This is easy enough to do with the following code, but enclosure requires length and mime fields. We could get the mime based on the thumbnail filename, but getting the size requires a network call to pict-rs, and thats just too slow.

    if let Some(thumbnail) = p.thumbnail_url {
      let mut enclosure = Enclosure::default();
      enclosure.set_url(thumbnail);
      i.enclosure(enclosure);
    }

@Nutomic Nutomic added the extra: good first issue Good for newcomers label Jan 16, 2023
@Elara6331
Copy link
Contributor

I believe the enclosure tag is meant to be used for prefetching, and I don't think it gets shown as a thumbnail in most RSS feed readers. I tried it on a few and it didn't show up as a thumbnail.

What does seem to work in most readers is the <media:content /> tag from the Media extension, which isn't supported by the rss crate yet (rust-syndication/rss#29). Specifically, this tag seems to work everywhere I've tried:

<media:content url="https://lemmy.ml/pictrs/image/84ccd4ee-a278-4bf0-9d63-dad21add2e50.jpeg?thumbnail=256" medium="image"/>

Here's what this looks like in Fluent Reader:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: rss enhancement New feature or request extra: good first issue Good for newcomers extra: help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants