Skip to content

1600px wide photos loading on a 400px wide phone ? #19

Open
@dukesx

Description

@dukesx

Hi,

I am a customer, and i recently switched from Imagekit to yours, specially for this plugin. I am very impressed with what you are trying to do here but what i am seeing is something not normal. Now considering the ratio is kept at 1.5, what i am seeing is that the image being loaded for smaller viewports (500px and below), is way too high, such as it renders a 1600px wide photo for a container of 400px.

I don't think this is a "responsive" behavior. That's a huge hit to the bandwidth if am downloading 400kb files on a phone, not to mention, a toll on overall speed. Most people are mobile oriented and lighthouse seemed to be the first to bring it to my notice. Please check.

Note: i am using Galaxy S5 and Pixel 2xl as models using browser responsive inspector to check which image is loaded for which viewport. I am using the latest version, with Next JS latest version (11.1.0 as of now)

Activity

dzmitry-stramavus

dzmitry-stramavus commented on Aug 26, 2021

@dzmitry-stramavus
Member

Hello @dukesx ,

thx for your report.

In order to see a good quality image, image should be x time bigger in cause your device has more than 1x Device Pixel Ratio (DPR) than width of image's container. For example, if the width of a container is 400px and your DPR is 3 => image should be load with 1200px width.

There is a param if you want to disable this https://github.com/scaleflex/react-cloudimage-responsive#devicepixelratiolist

If there is no need to support retina devices, you should set an empty array devicePixelRatioList: [].

dukesx

dukesx commented on Aug 26, 2021

@dukesx
Author

Hi, I have tried it with the empty array for device pixel ratio and now the behavior is even worse, full 8mb image for a pixel2xl (403px width) device and a 1000x width image for galaxy S5 (360px width)

dzmitry-stramavus

dzmitry-stramavus commented on Aug 26, 2021

@dzmitry-stramavus
Member

@dukesx ,

We will check that asap. Thx for letting us know

dukesx

dukesx commented on Aug 26, 2021

@dukesx
Author

Thank you , i have high hopes with you guys, and you have my full support. Let me know how it works out

amrelbialy

amrelbialy commented on Aug 27, 2021

@amrelbialy
Collaborator

Hey @dukesx, We tested on Galaxy S5 and pixel2xl using browser console and also Honor play as a real device. We only found the issue in pixel2xl when we set devicePixelRatioList to an empty array. So we will test it further until that can you please give us full feedback.

dukesx

dukesx commented on Sep 2, 2021

@dukesx
Author

Hey @dukesx, We tested on Galaxy S5 and pixel2xl using browser console and also Honor play as a real device. We only found the issue in pixel2xl when we set devicePixelRatioList to an empty array. So we will test it further until that can you please give us full feedback.

Sure absolutely. I am just not sure that mobile devices should load large images, it's just not good for the lighthouse score that now actually will rank your website in SEO ranking

amrelbialy

amrelbialy commented on Sep 2, 2021

@amrelbialy
Collaborator

Yes you are right we shouldn't use large images on mobile devices and when we tested on the images in our lib demo. For example in Galaxy S5 and Honor play the image was 76.1 kb in size. And in Pixel2Xl it was 141 kb. The issue only happened when we set devicePixelRatioList to an empty array. Here the file size was 598kb.

dukesx

dukesx commented on Sep 3, 2021

@dukesx
Author

Yes you are right we shouldn't use large images on mobile devices and when we tested on the images in our lib demo. For example in Galaxy S5 and Honor play the image was 76.1 kb in size. And in Pixel2Xl it was 141 kb. The issue only happened when we set devicePixelRatioList to an empty array. Here the file size was 598kb.

Exactly, the picture in pixel 2 xl still comes quite large, now if its an 8mb landscape photo, then you should probably find a 400kb size worth of photo as compared to galaxy s5 where the photo would come 100 to 150kb. This 400kb vs 120kb difference in size bothers me. I mean I am going to be honest, the loading times just frustrated me on my Galaxy s10+, just because of a photo. I am not sure what size would he rendered on my device but should be significantly large. I think the algorithm needs more refinement. Personally, I feel that the src set approach is just a menace. I never got it to work efficiently, months ago when I first tried it and now I see that it still hasn't changed. There must be another approach to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      1600px wide photos loading on a 400px wide phone ? · Issue #19 · scaleflex/react-cloudimage-responsive