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

Displays images with inappropriate size #11450

Closed
andymathieson opened this issue Sep 18, 2020 · 7 comments · Fixed by #11457
Closed

Displays images with inappropriate size #11450

andymathieson opened this issue Sep 18, 2020 · 7 comments · Fixed by #11457
Assignees

Comments

@andymathieson
Copy link

Screenshot 2020-09-17 at 14 06 46

When running an audit on mobile, or if I run an audit on a 4k or 5k monitor where the DPI is 2x, we get marked down on our score.

In the screengrab above, you can see that lighthouse is expecting an image of 2198x2150. You can also see that the image being served has the dimensions of 2200x1252. However, the displayed size and actual size don't correspond.

I get a 100 if testing on a standard dpi monitor.

@patrickhulce
Copy link
Collaborator

Thanks for splitting this out into another issue @andymathieson!

I can reproduce this on http://melodic-class.glitch.me/image-srcset.html which reports the 800x400 source image as only 360x180.

@patrickhulce
Copy link
Collaborator

@andymathieson are your images also served after a redirect from the original src attribute? If so we've found the same root cause.

@andymathieson
Copy link
Author

Hi @patrickhulce

We do use lazyloading from a Src Set. So we actually have a data-src-set. I can understand it if lazyloading threw a bug, but that should also happen at a standard DPI should it not?

@patrickhulce
Copy link
Collaborator

I'm not sure I understand your response. I'm asking if the image URLs you reference in your src/srcset/data-srcset return a 301/302 redirect to the underlying resource (as many image CDNs seem to do).

If they do, then I have found the cause of the bug.

If they don't, then I cannot reproduce what you're talking about and there's more than one issue going on here (so we'll need a public URL or more detailed reproduction information from you in order to help).

@andymathieson
Copy link
Author

No problem. I can't post to a clients website but I will build a little mockup in the next day or two. Thanks

@patrickhulce
Copy link
Collaborator

No problem. I can't post to a clients website but I will build a little mockup in the next day or two. Thanks

Does this mean those images do not redirect then? :/

And awesome, thank you that would be great if it's different!

@andymathieson
Copy link
Author

I have tested 2 systems. 1 with CDN, one without. The results are the same. We use cloudfront for CDN and I havent added any redirects unless Amazon does it of its own accord. That wouldn't explain the non-CDN version tho.

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

Successfully merging a pull request may close this issue.

3 participants