redlib-org / redlib

Private front-end for Reddit
GNU Affero General Public License v3.0
1.18k stars 87 forks source link

💡 Feature request: Don't show fully sized image until clicking into a post or opening the image #96

Open ButteredCats opened 5 months ago

ButteredCats commented 5 months ago

Is your feature request related to a problem? Please describe.

It's just slow loading that manifests from limited bandwidth that could be helped by implementing this. It isn't a problem caused by Redlib itself.

Describe the feature you would like to be implemented

When scrolling through a subreddit or the homepage, images should be resized versions to save on bandwidth. Clicking on these should open the full sized version, and the full size version should also be shown once you're in the post itself.

Describe alternatives you've considered

Images could be converted to WebP before being sent. This could potentially be done alongside this suggestion to increase savings even further.

Additional context / screenshot

I host https://redlib.catsarch.com on a connection with only 25Mbps upload. On subreddits that contain multiple large images like /r/wallpapers this can cause the initial load to be quite slow. Screenshot_20240414_144754 These are just the largest images. Overall the front page of /r/wallpapers was 66.84MB when I took this screenshot. Under absolutely perfect conditions it would take around 21.388 seconds for that to be loaded on my instance.

azizLIGHT commented 5 months ago

Would it be possible to use a expando like in RES on old reddit to show/hide large images with a mouse click. All images unexpanded on the page until clicked, but you can still see the small sized preview image for each post

ButteredCats commented 5 months ago

I'm not proposing that they're actually smaller, just a lower resolution. I probably should have clarified that.

sigaloid commented 3 months ago

I played around with adding compression and it was atrociously slow while only adding 5-10% bandwidth savings. Reddit doesn't provide any alternate sizes for those images besides the thumbnail version which look like this image versus this image which would probably be a bad user experience if every user had to open every post to view the high resolution version

ButteredCats commented 3 months ago

That's unfortunate, I do appreciate you looking into it though.

Would it be possible to convert them to webp? Using that larger image you just posted it goes from 490.2 KiB to 35.6 KiB just by converting it to webp with default settings in gimp.

I know that Intellectual does this, and Rimgo has an option to force it.