How Discord Resizes 150M Images Every Day with Go and C++
Why don't more companies resize images client-side first using <canvas> and then save the server some work by only asking it to verify the result by<p>- resizing to the same size<p>- removing metadata<p>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.<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/API/CanvasRende...</a><p># Edit: On Keeping Full Resolution Images<p>Some people mention having original highest-resolution images are important. I don't think that is true for most applications.<p>Most apps don't need hi-resolution history as much as current, live engagement so older photos being smaller isn't a big deal. As technology moves on you simply start allowing higher-res uploads. Youtube, facebook, and others have done this fine as the older stuff is replaced with the new/current/now() content.<p>In fact, even our highest resolution images are still low-quality for the future. Pick a good max size for your site (4k?) and resize everything down to that. In a year, bump it up to 6k, then 10k, etc...<p>Keeping costs low has it's benefits, especially for us startups. Now if you have massive collateral, then knock yourself out.