Server-side avatar resizing?

Member
Joined
Jan 19, 2018
Messages
67
I've noticed that if a user has set their own avatar, it seems like that image is resized on the fly by a user's browser when you visit pages. There are times I visit a comment section and for a second or two I see everyone's full-size avatar images taking over the screen before they're shrunk back down to avatar size, and if I right click -> view image, it takes me to a full-res image rather than a resized, typical avatar-sized one.

I doubt the bandwidth used by requesting full-size images for avatars really stacks up meaningfully at all against, you know, running a manga hosting site, but if y'all are ever looking for an easy way to shave a bit off that usage, I think you could make some immediate gains by doing a single resize server-side to a typical avatar pixel size when a user uploads an image in addition to the 1mb upload limit. I did a small check (md5sums match) and there's no manipulation done to whatever the uploaded image is, it sends the whole file to the user for all the avatars on the page.
 
Dex-chan lover
Joined
Jan 20, 2018
Messages
1,055
> for a second or two I see everyone's full-size avatar images taking over the screen

Looks like your browser issue. In my case it's always properly sized to 100x100 even if it wasn't fully loaded or didn't load at all.
 
Member
Joined
Jan 19, 2018
Messages
67
Oh I'm fully aware the "taking over the screen" thing is a "my browser" issue - I'm still on firefox v56 for reasons I'd rather not get into. This isn't the only website I have slow page loads on. That's secondary, though. Noticing that issues is just what alerted me to the behavior that the images are delivered to the browser full-size and then resized on the fly. And that is a delivery issue, not a browser - if I use an up-to-date version of Chrome and right click -> copy image on an avatar, the image I copy is the full-sized image, not a resized 100x100 one.

I wrote the suggestion not because I want that screen thing fixed for myself, but because the behavior is a potential bandwidth hog that doesn't need to exist. If a typical user never see anything but the 100x100 resized avatar, why deliver the full images? That's (worst case) potentially a 20 megabyte slug of data per page every time you load a page of comments on a forum or comment thread.
 

Users who are viewing this thread

Top