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

Google Lighthouse complains about 'Properly size images' for an image marked 'passed' by RespImageLint #70

Open
danielbachhuber opened this issue Jan 31, 2022 · 2 comments
Labels

Comments

@danielbachhuber
Copy link

Following up on #62 (comment), I wanted to document an example of an image that Google Lighthouse is still complaining about, even though it's marked 'passed' by the bookmarklet. I don't know that we'll ever want to solve it given GoogleChrome/lighthouse#11593 (comment), but capturing for reference.

image

image

Here is the image's markup:

<img width="840" height="1200" src="https://staging.pinchofyum.com/wp-content/uploads/Instant-Pot-Beef-Stew-1-3-840x1200.jpg" class="object-cover self-center w-44 h-44 md:w-full md:h-auto" alt="A pot of stew on a blue tablecloth." loading="eager" data-pin-nopin="true" sizes="(min-width: 1220px) 276px, (min-width: 820px) calc(23.95vw - 11px), (min-width: 440px) 171px, 41.67vw" srcset="https://staging.pinchofyum.com/wp-content/uploads/Instant-Pot-Beef-Stew-1-3-840x1200.jpg 840w, https://staging.pinchofyum.com/wp-content/uploads/Instant-Pot-Beef-Stew-1-3-420x600.jpg 420w">

On the Moto G4, here's how the image appears:

image

@ausi
Copy link
Owner

ausi commented Jan 31, 2022

Directly targeting Google Lighthouse is not something I would be extremely happy with I think.

But looking at some statistics it seems that 360px is a very common with for smartphones. More than 50% of mobile traffic seems to have a resolution of 360 to 375 pixels wide.

With this in mind one could argue that the threshold for screen sizes from 360 to 375 should be set very low because of the huge number of users that will have exactly this screen resolution.

So checking for 360 and 375 (with @​2x) using a lower threshold could be a good solution that works for everybody and is also closer to what Lighthouse does.

What do you think?

@danielbachhuber
Copy link
Author

I think your assessment would be a very sensible approach.

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

No branches or pull requests

2 participants