Skip to content

Ensure layout version selection sets element size for exclusively unscaled images#692

Open
liamwhite wants to merge 1 commit into
masterfrom
scaling-issue
Open

Ensure layout version selection sets element size for exclusively unscaled images#692
liamwhite wants to merge 1 commit into
masterfrom
scaling-issue

Conversation

@liamwhite
Copy link
Copy Markdown
Contributor

Fixes visual regression from #652 for scaled/partscaled images that extend off the viewport

@liamwhite
Copy link
Copy Markdown
Contributor Author

@uis246 for the record, the change you made breaks if the image's partscaled height exceeds 80vh

@uis246
Copy link
Copy Markdown
Contributor

uis246 commented May 5, 2026

How do I reproduce it?

@liamwhite
Copy link
Copy Markdown
Contributor Author

Upload an image like https://derpibooru.org/images/3800399 and then view it scaled or partscaled with a 1600x1920 viewport, and it'll be squished

@uis246
Copy link
Copy Markdown
Contributor

uis246 commented May 5, 2026

Firefox devtools emulate "a phone" with 1600x1920 screen with DPR=1 and touch off.
Open link, turn image to partscaled and type into console

for (i of document.getElementsByClassName('image-target')) {pic = i.children[0].children[0]; ds = i.dataset; pic.height = ds.height; pic.width = ds.width;}

See nothing happen.

image's partscaled height exceeds 80vh

Maybe scaled? Only scaled image mentions 80vh.

@liamwhite
Copy link
Copy Markdown
Contributor Author

Forgot how dimensions work - meant 1920x1600

@uis246
Copy link
Copy Markdown
Contributor

uis246 commented May 5, 2026

Forgot how dimensions work - meant 1920x1600

Scaled and unscaled have same size.

What will happen if you add

img {
 height: auto;
 width: auto;
}

to styles? Will problem persist?

@liamwhite
Copy link
Copy Markdown
Contributor Author

liamwhite commented May 5, 2026

Yes, doing that does unskew the aspect ratio. Here is the computed style tree for the img element btw
image

And also the skewed version that appears at 1920x1600
Screenshot 2026-05-05 at 15-25-21 #8 - safe artist thejunebug oc flawless sparklemoon 3 animated animated png belly belly button clothes digital art drop shadow female fusion fusion trixie fusion twilight sparkle fusion twixie hat hoof hold horn

@liamwhite
Copy link
Copy Markdown
Contributor Author

Apparently in addition to swapping dimensions I also do not know how to count - it should have been 1920x964

@uis246
Copy link
Copy Markdown
Contributor

uis246 commented May 5, 2026

it should have been 1920x964

Reproduced.
This somehow works.

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