Image natural dimensions strict to the precision of 4th decimal place
See original GitHub issueHello, 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.
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:
- Created 3 years ago
- Comments:11
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.Thank you for the quick feedback!