LemmyNet / lemmy-ui

The official web app for lemmy.
https://join-lemmy.org/
GNU Affero General Public License v3.0
887 stars 335 forks source link

Regression of image thumbnails from non-lemmy sources #1917

Open poVoq opened 1 year ago

poVoq commented 1 year ago

Requirements

Summary

Looks like this recent change broke image thumbnailing for external non-lemmy sources: https://github.com/LemmyNet/lemmy-ui/pull/1858

See example here: https://lemmy.ml/post/1949407

It seems to load the entire full-size image from Imgur even in the community overview, which will have a strong impact on page performance.

Steps to Reproduce

https://lemmy.ml/post/1949407

Likely happens with all non-lemmy image sources?

Technical Details

Before the opposite happend, where only those external sources would be cached.

Lemmy Instance Version

0.18.2

Lemmy Instance URL

No response

pallebone commented 1 year ago

I think this can also happen if pictrs has some issue with doing something with the provided image for some reason. Like if it doesnt know what to do it just gives up.

poVoq commented 1 year ago

In that case it would be better though to not show a image at all as loading the full image just to show a tiny thumbnail in every user's browser is a huge waste of energy.

lemmus-org commented 1 year ago

I believe the old logic would have ended up with the same result. This looks like an issue due to the initial thumbnail generation failing where it defaults to the post URL. I think this needs to be addressed on the backend to ensure the url and thumbnail_url values are reliable for all clients. Or at least eventually correct.

poVoq commented 1 year ago

Another really bad example. This literally loads a 2.2mb picture as a thumbnail :(

https://lemmy.world/post/77946