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

Improve client image resize #645

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Improve client image resize #645

wants to merge 2 commits into from

Conversation

po5
Copy link
Contributor

@po5 po5 commented Mar 21, 2024

Fixes a lot of jank when resizing images to fit the viewport. See extended commit messages.
We need to replace all this with CSS someday.

po5 added 2 commits March 21, 2024 20:36
Images in fit mode 'width' and 'both' would extend to the very edge
of the screen on desktop. The right side margin was previously only
addressed on mobile from god knows where... (the lack of a scrollbar?)
Instead of trying to guess the post content width, we can set
overflow-x: hidden on the container which lets us get the real value.
Viewport height on Android was wrong when the address bar was shown,
causing unnecessary and jumpy image resizing. Use iOS hack.
All this sizing bs should really be done by toggling classes and using
regular css min/max width. For "Upscale small posts" option as well.
Still not perfect for comment section and edit mode, but we should
really replace image resizing logic with css.
@po5 po5 changed the title Improve image resize Improve client image resize Mar 21, 2024
@65947689564
Copy link

@po5 @neobooru @Hunternif (Kind of just tagging random contributors) Have any of you looked into/made progress on using CSS for client image resizing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants