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

core(image-aspect-ratio): loosen aspect ratio threshold #15328

Merged
merged 4 commits into from
Sep 6, 2023

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Aug 2, 2023

Closes #15326

@adamraine adamraine requested a review from a team as a code owner August 2, 2023 21:21
@adamraine adamraine requested review from connorjclark and removed request for a team August 2, 2023 21:21
@@ -59,7 +60,9 @@ class ImageAspectRatio extends Audit {
const displayedAspectRatio = image.displayedWidth / image.displayedHeight;

const targetDisplayHeight = image.displayedWidth / actualAspectRatio;
Copy link
Collaborator

@connorjclark connorjclark Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a threshold ratio. Could we just Math.min/max (don't make me engage my brain to determine which way right now :P ...) image.displayedWidth / actualAspectRatio?

I'm thinking that 0.01 is pretty arbitrary and possibly leaves the general case unsolved.

@adamraine adamraine merged commit 0f2bfa3 into main Sep 6, 2023
27 of 28 checks passed
@adamraine adamraine deleted the aspect-ratio-threshold branch September 6, 2023 22:02
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.

Image aspect ratio test is too strict?
2 participants