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(img-usage): handle invalid images within determineNaturalSize #4812

Merged
merged 1 commit into from
Mar 19, 2018

Conversation

paulirish
Copy link
Member

@paulirish paulirish commented Mar 19, 2018

fixes https://sentry.io/google-lighthouse/lighthouse/issues/407848291/.. our 4th most common error!

It's reproducible on https://www.habitatetjardin.com/ with this image (https://i.habitatetjardin.com/images/bandefin_jardin.gif), though there's probably another URL that's a tad more minimal.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

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

The Sentry link is for Error: unknown error but seems like we might just be trading this out for Invalid image sizing information, no?

if (!Number.isFinite(actualAspectRatio) ||
!Number.isFinite(displayedAspectRatio)) {
return new Error(`Invalid image sizing information ${url}`);
}

Change seems like an improvement either way 👍

@paulirish paulirish merged commit 0206170 into master Mar 19, 2018
@paulirish paulirish deleted the imgusage-unknownerror branch March 19, 2018 20:06
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.

None yet

3 participants