srcset 속성으로 모바일에서 데스크톱보다 큰 이미지가 로드될 수 있음

Did anybody notice something funny as the above preview loaded onto your cellphone screen?

Why was the image taking so agonizingly long to finally fill in the entire preview square?

That’s because it’s a very large image!

So why does a very large image need to be gobbling up the user’s data plan, taking so long when an itsy bitsy preview would have shown up before you would have even noticed it?

No I’m not exactly sure who to blame.

No. It’s not a bug. The image gets there sooner or later. I’m just saying it’s bad User Experience. The user thinks nobody cares about his data plan, and the page doesn’t finish loading as fast as other pages.

2개의 좋아요

I didn’t really notice the loading time, which suggests it’s your browser or network.

First time from a different device:

That one was Chrome on iOS

2개의 좋아요

Not so fast. You, in your Ivory Tower in your first world country would never know the difference. But me in my non Ivory tower, in my non first world country, notice the difference very much!

Use Developer Tools, set Country to second or third world, :smile:, turn off the cache, and reload the page.

1개의 좋아요

So your complaint is with your ISP and their peering?

To be clear the original image is 3.4mb, that thumbnail is served from Cloudfront, is 690x460 and weighs in at 164Kb.

Either way, what are you proposing? That cloudfront makes for a bad CDN for users in your region? That Discourse didn’t download and create the optimized images quickly enough?

3개의 좋아요

All I know is those dimensions are larger than the entire cell phone screen itself!

1개의 좋아요

I have a small smartphone (4.6 inch | 720 x 1.280 pixel). My screen is not smaller that the thumbnail. How small is your screen?

1개의 좋아요

In your non ivory tower country where data is 8x cheaper than in the USA and still 2.5 times cheaper than in Europe? (source) or do you mean in your non ivory tower country with the fastest broadband internet in the world (source) ? Or maybe you meant your non ivory tower country that for mobile data still ranks 28th, way above many first world countries? (source)

Sounds like you just need a bigger phone.

4개의 좋아요

Judging by previous posts Jidanni has a Galaxy A13 5G and a Zenfone 3:

Galaxy A13 5G: 6.5”, 1600 x 720
Asus Zenfone 3: 5.5”, 1920 x 1080

As the optimized thumbnail is 690x460, and it’s dimensions are further restricted by the onebox, it isn’t bigger than their screen. They do use browser scaling though, so who knows :man_shrugging:t2:

1개의 좋아요

여기 뭔가 수상해 보입니다.

데스크톱 뷰에서는 onebox가 690x460px, 160 KB 사진을 로드하는 반면, 모바일에서는 1380x920, 500 KB 사진을 로드합니다. :thinking:


주제를 #contribute:bug로 이동합니다. 제 생각에는 버그인 것 같아서, 나중에 다시 분류될 수도 있겠네요 :slight_smile:

4개의 좋아요

I may be wrong, but I think it makes sense.
If you look at the HTML srcset, the following images are served based on the device pixel ratio (x1, x1,5, x2).

https://...2f50d4ad9f5f865b783b02d392de75bdceec01da_2_690x460.jpeg,
https://...2f50d4ad9f5f865b783b02d392de75bdceec01da_2_1035x690.jpeg 1.5x, 
https://...2f50d4ad9f5f865b783b02d392de75bdceec01da_2_1380x920.jpeg 2x

Usually, mobile has an x2 ratio (or more) because they have a higher pixel density.
So you would want to serve images with higher resolution.

Device Pixel Ratio

Device Pixel Ratio(DPR) is a number given by device manufacturers and it’s used for HiDPI(High Dots Per Inch) or Retina(Apple’s trademark) displays, which are part of modern smartphones, tablets and even some laptops and monitors.
DPR is in direct correlation with pixel density of the display, the higher the density the greater the DPR value.

DPR is the ratio between physical(device) pixels and logical(CSS) pixels in either horizontal(width) or vertical(height) direction of a screen.
In other words, DPR is a number used for calculating CSS resolution of the screen. From DPR we can directly see how many actual physical hardware pixels make up one CSS pixel.

Example:
Apple iPhone 12
Resolution in device(physical) pixels: 1170 x 2532
DPR: 3
Width: 1170/3 = 390, Height: 2532/3 = 844
Therefore, resolution in CSS pixels: 390 x 844

Since DPR is 3, in pixel grid: 3(width) x 3(height) = 9; 9 physical pixels are used to form one CSS pixel.

5개의 좋아요

yea i don’t believe this is a bug. my ipad on mobile view loads higher res photos than my desktop because it can. i could be wrong, but it was my understanding that it’s dependent on device capability, not screen size.

also, i’m still not clear on whether this topic is about the one box thumbnail itself or the actual photo loading when you click the one box link?

2개의 좋아요

좋은 지적이네요.

스마트폰은 화면 크기가 작아서 해상도가 낮은 이미지를 사용해도 사용자가 거의 인지하지 못할 가능성이 높습니다. 그리고 일반적으로 모바일 네트워크를 통한 인터넷 연결이 가정용 인터넷 연결보다 느린 경우가 많다고 생각합니다. 따라서 모바일 환경에서는 데스크톱 컴퓨터보다 더 큰 이미지를 로드하는 것을 기대하지 않을 것입니다.

하지만 scrset은 픽셀 비율에 따라 어떤 이미지를 로드할지 지정합니다. :confused:

이것은 분명히 버그가 아니므로 Contribute > UX 로 다시 이동하겠습니다. :person_shrugging:

2개의 좋아요

The thumbnail.

Indeed here we see in the Kiwi browser the Developer Tools results,

Yes, we’re talking at 500 kilobyte thumbnail.
What would Tim Berners-Lee think?

Okay, I did a web search and indeed it’s a reasonable size for a thumbnail – if you are uploading it to YouTube.

I mean it must be a pretty fantastic hologram 50 dimensional thumbnail or something. Are you sure you couldn’t do the same one about 5000 bytes? Would the user be able to detect any difference? No I’m not blaming anybody for the energy crisis or slowing down the web. I just think with the destination being a small cellphone something could be done better.
I mean there has to be some point where just adding more bytes, no matter what cellphone sized device they have, won’t make any difference for human beings unless they have eagle eyes but they’re not eagles they’re humans.

2개의 좋아요

I agree something is off here for sure … that image is way too big. Our onebox implementation is asking for a supersized image when a much smaller one would do.

We will have a look over the next month or so.

7개의 좋아요

This PR has just been merged that addresses the onebox thumbnail size issue specifically for Wikimedia links.

https://github.com/discourse/discourse/pull/22620

And here is a Wikimedia link to test it out:

A more general fix applicable to all onebox thumbnail sizes will still need to be developed.

4개의 좋아요

A more general fix for all oneboxes has been created:

https://github.com/discourse/discourse/pull/22621

For testing I used articles from this non-wikimedia site: Read the latest Great Reads stories from car lovers like you - Hagerty Media as they had fairly large images to onebox.

Before:

After:

Before this change onebox images were around 400kb. After my change they are around 100kb.

Here is a onebox example which is using the reduced thumbnail size

https://www.hagerty.com/media/car-profiles/driving-the-prodrive-p25-brought-out-my-inner-car-crazy-kid/

4개의 좋아요

This topic was automatically closed after 41 hours. New replies are no longer allowed.