Skip to content

Improve client image resize - #645

Open
po5 wants to merge 2 commits into
rr-:masterfrom
po5:image-resize
Open

Improve client image resize#645
po5 wants to merge 2 commits into
rr-:masterfrom
po5:image-resize

Conversation

@po5

@po5 po5 commented Mar 21, 2024

Copy link
Copy Markdown
Collaborator

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
@pelicans45

Copy link
Copy Markdown

@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