Why don't more companies resize images client-side first using and then save the server some work by only asking it to verify the result by - resizing to the same size - removing metadata This results in much faster transfer (10x less bandwidth used often for mobile uploads) and reduces server load by "farming" out the work to the clients. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRende... # Edit: On Kee…
This is for proxying images that users link in chat, not for when users upload images to the service. It doesn't make sense to talk about doing this resize on the client, as the client doesn't have the image.
How Discord Resizes 150M Images Every Day with Go and C++
71–80 of 157 posts
Re: How Discord Resizes 150M Images Every Day with Go and C++
#72I wish Cloudfront supported resize parameters so we wouldn't have to keep buildings these or paying a lot for Imgix.
How much would you pay for an image resizing service? I'd been thinking for a while of putting a fleet of autoscaled thumbor boxes behind cloudfront and making a billing API for it.
Re: How Discord Resizes 150M Images Every Day with Go and C++
#73Earlier quoted context omitted.
A few reasons: 1) Although the site serves up images at 1024 pixels (or whatever) today, in the future they may want larger images. When everyone is rocking 10K monitors and 6K phone displays, those small images are going to look pretty bad. 2) The original image has some metadata that they want to keep (geolocation, etc). 3) They think they can do a better and more consistent job resizing than the various browsers,…
> 2) The original image has some metadata that they want to keep (geolocation, etc). Isn't exif data something you should strip out?
Re: How Discord Resizes 150M Images Every Day with Go and C++
#74Also http://thumbor.org and https://imageresizing.net if you want a library to host yourself which are already very fast and well tested. Put them in a docker container on a kubernetes cluster and it's all done in an hour.
Re: How Discord Resizes 150M Images Every Day with Go and C++
#75Why don't more companies resize images client-side first using and then save the server some work by only asking it to verify the result by - resizing to the same size - removing metadata This results in much faster transfer (10x less bandwidth used often for mobile uploads) and reduces server load by "farming" out the work to the clients. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRende... # Edit: On Kee…
Re: How Discord Resizes 150M Images Every Day with Go and C++
#76Nice, but why? https://cloudinary.com , https://www.imgix.com , or https://www.filestack.com already exist and are well worth it for 99% of apps. Even at scale, it really doesn't cost that much to have someone else do it. You can use a thin proxy through your existing CDN if you want to save on their bandwidth fees. Also http://thumbor.org and https://imageresizing.net if you want a library to host yourself which are…
Re: How Discord Resizes 150M Images Every Day with Go and C++
#77I wish Cloudfront supported resize parameters so we wouldn't have to keep buildings these or paying a lot for Imgix.
How much would you pay for an image resizing service? I'd been thinking for a while of putting a fleet of autoscaled thumbor boxes behind cloudfront and making a billing API for it.
Don't need anything fancy. Just w=? h=? would be great, developers can handle the DPI stuff with sourceset tags.
Re: How Discord Resizes 150M Images Every Day with Go and C++
#78Earlier quoted context omitted.
> 2) The original image has some metadata that they want to keep (geolocation, etc). Isn't exif data something you should strip out?
Discord makes most of their revenue from selling user data so they probably want to keep as much as possible.
Re: How Discord Resizes 150M Images Every Day with Go and C++
#79Why don't more companies resize images client-side first using and then save the server some work by only asking it to verify the result by - resizing to the same size - removing metadata This results in much faster transfer (10x less bandwidth used often for mobile uploads) and reduces server load by "farming" out the work to the clients. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRende... # Edit: On Kee…
Re: How Discord Resizes 150M Images Every Day with Go and C++
#80Nice, but why? https://cloudinary.com , https://www.imgix.com , or https://www.filestack.com already exist and are well worth it for 99% of apps. Even at scale, it really doesn't cost that much to have someone else do it. You can use a thin proxy through your existing CDN if you want to save on their bandwidth fees. Also http://thumbor.org and https://imageresizing.net if you want a library to host yourself which are…
Maybe it’s because that they don’t want a dependency on a external service that could go down ?