-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Can't get consistent Gatsby Img behavior #6532
Comments
Hmm can you replicate the same behaviour with the |
I am trying to reproduce it, but everyting works fine on iphone(images get blurred and appear as expected). |
This is the closest I could get to reproducing this issue in more or less isolated environment. https://d-ivashchuk.github.io/test/ I've used Thanks for patience and help! |
Ah yeah — lazy loading doesn't work on IOS due to it not supporting IntersectionObserver. Closing this in favor of #4021 as we need to document this. |
@KyleAMathews currently the newest version of iOS Safari supports IntersectionObserver. However, I am still getting weird behaviour and on Safari is loading extremely huge images on mobile. I believe is due to Safari not support WebP. As per @coreyward comments here: #4926 Could it be? What should be the workaround? |
@PolGuixe Are you using source images that are in WebP or setting the format argument to The Which is all to say that you can safely include WebP images in a srcset served to Safari provided you do not only have WebP images in that srcset, and with Gatsby Image, the only way to mess that up is to either have your original images in WebP (exceedingly unlikely) or to set the If neither of these are the case and you are using a recent version of Gatsby Image (e.g. 2.2.x+) you may want to open a new, fully detailed issue. |
Since you're using That 1200px wide image would probably be a smaller file size, but you've set the quality to 100%, which will result in minimal compression and large file sizes. As for additional images loading, you have caching disabled, which is not an expected condition for normal users; if you re-enable caching you'll likely see that those images are not re-requested from the server but instead served from cache.
|
@coreyward I am using quality 100% to accentuate the effect of these big pictures. 😅 Won't go like this into production. I've checked the size of the image downloaded and instead of 1200px, the image is 1800px which is the next resolution step. The device I am using for testing is an iPhone 8 Plus. Edit: pixel ratio on this device is about 3, screen width 414px --> 414*3= 1242 > 1200 hence it jumps to the next resolution step. Just to confirm best practices:
I'll keep doing a test to see if I can get a good consistency. |
If you know that this is exclusively going to be used by iOS you could just leave off the
If by this you mean that the
😉 |
Description
I've finally managed to get Gatsby images work as expected on desktop devices, to find out that they are totally not working on mobile safari/firefox/chrome on ios devices. Moreover, I can't get consistent behavior of images when deploying my project on gh-pages. One deploy everything works, other one, with no changes at all, images just get stuck on blur phase. I found a temporary fix of deleting cache folder in my project, but I don't think that it's the best way of solving this.
Steps to reproduce
Plugins that I use
Queries (note: they are placed in separate pages):
Images:
Expected result
1)I expect everything to work on every
npm run develop
ornpm run deploy
but from time to time they are not working in both development mode and build mode.2)I expect images to have lazy load on mobile devices, but it seems like they don't even have blur, when page loads and behave like normal
<img>
Actual result
You can see demo of not working mobile images here:
https://d-ivashchuk.github.io/taurus-gatsby/photos
Or here:
https://d-ivashchuk.github.io/taurus-gatsby/legal
Environment
Apart from this issue I want to thank you guys for creating Gatsby and helping people like me to become proficient with it. Great Job!
The text was updated successfully, but these errors were encountered: