question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Aspect ratio audit fails on SVG

See original GitHub issue

The image aspect ratio audit appears to fail for SVG images. If you run a “best practices” audit on the standalone HTML file in this zip (unzip it and put it on a webserver) you’ll see it includes

Does not uses Images with appropriate aspect ratio
Image displayed sizes should match their natural aspect ratio.

I’ve tried it with different combinations of width/height attributes and CSS, and none can make it pass the audit.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
patrickhulcecommented, Nov 2, 2017

Thanks so much for volunteering @TejasQ but Peter beat you to the punch 😄 feel free to take a look at some of our other good first issues!

0reactions
leonardorey1970commented, Nov 14, 2017

Thanks patrickhulce for your reply!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Lighthouse and SVGs with preserveAspectRatio="none"
Lighthouse reports the error: Displays images with incorrect aspect ratio. precisely because the SVG includes the preserveAspectRatio="none" ...
Read more >
Displays images with incorrect aspect ratio
How the Lighthouse image aspect ratio audit fails · Ensure images display with the correct aspect ratio. Use an image CDN; Check the...
Read more >
Google Lighthouse and SVGs with preserveAspectRatio="none"
Google Lighthouse has a red triangle error which significantly impacts the Best Practices score: Displays images with incorrect aspect ratio.
Read more >
preserveAspectRatio - SVG: Scalable Vector Graphics | MDN
The preserveAspectRatio attribute indicates how an element with a viewBox providing a given aspect ratio must fit into a viewport with a ...
Read more >
Why Lighthouse says image elements lack width and height ...
The reason? The aspect-ratio CSS property is relatively new (Edge & Chrome support since January 2021) and is a browser default property for ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found