Replies: 1 comment
-
Hey, this is not a bug. The browser calculates the image with DPI (dots per inch) in mind. For Moto G4 this is 3x which means it gets the image 3x the screen width. You can change the behaviour while using sizes in https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-plugin-image/#all-options |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In a smaller screen. the biggest image is selected and downloaded despite there is a smaller, more fitting image available.
Edit: I suspect it is due to the
sizes
prop specified in<img>
and<picture>
.Edit 2: The same goes for https://react18ecommercedemo.gatsbyjs.io/. The one using React 18
Edit 3: It appears only appear when the screen size is small. e.g. the Moto 4, iPad, and iPad Pro preset of Chromium-based browsers
Steps to reproduce
Consider the default template: https://gatsby-starter-default-demo.netlify.app/
gatsby-astronaut.png
is downloaded.Expected result
The 300w version of the image should be used.
Actual result
The 800w version of the image, i.e. the largest version of the image, is used instead.
Environment
Beta Was this translation helpful? Give feedback.
All reactions