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.

Image natural dimensions strict to the precision of 4th decimal place

See original GitHub issue

Hello, I noticed a “best practices” issue while testing some image srcsets. Here’s a similar issue from 2018 (#5356) where the ratio check was loosened.

What is the current behavior?

At first, it looked like an image size issue, but using object-fit: cover; fixed it. So I checked the ratio and found that there are small differences between what’s being displayed and the natural dimensions of the image.

Screenshot 2020-10-01 at 14 31 54

1st image displayed and expected vs displayed ratio is: 0.9473 (360x380, 1080x1140) vs 0.9478 (800x844) 2nd image displayed and expected vs displayed ratio is: 1.2631 (360x285, 1080x855) vs 1.2618 (800x634)

What is the expected behavior?

Unless I’m misunderstanding the “natural dimensions” audit, a check which is a little bit less strict.

Environment Information

  • Affected Channels: DevTools
  • Lighthouse version: 6.0.0
  • Chrome version: Version 85.0.4183.121 (Official Build) (64-bit)
  • Node.js version:
  • Operating System: macOS Catalina

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
patrickhulcecommented, Oct 2, 2020

I’m going to let this issue track updating quantizeDPR to never use anything more than 2 and the expectations accordingly, which should also fix the DevTools problem you’re seeing.

0reactions
zenofewordscommented, Oct 3, 2020

Thank you for the quick feedback!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting decimal place precision on hole reference in dimension
I'm placing a dimension for a tapped hole. For the hole itself, I 'm using 3 decimal places for the diameter range.
Read more >
Guide: Capacity Calculations: Handle with Care - Fortra
This paper discusses avoiding calculation results that are more precise than is justified by precision of corresponding measurement input data.
Read more >
Accuracy and Precision
The precision of a measurement is the size of the smallest unit in it. ... For numbers less than 1, zeros between the...
Read more >
Significant Figures, Dimensioning, and Tolerance - Copyright
A significant figure is any nonzero digit or any leading zero that does not serve to locate the decimal point. A number cannot...
Read more >
High precision calculator - keisan
High precision calculator (Calculator) allows you to specify the number of operation digits (from 6 to 130) in the calculation of formula.
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