News for hackers. Stuff that matters.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by AndrewStephens on Tuesday November 14, 2017 @12:35PM (#15697220)
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, which is probably true.

Re:How Discord Resizes 150M Images Every Day with Go and C++ by malux85 on Tuesday November 14, 2017 @01:34PM (#15697826)
agree on 3) most browsers just use linear interpolation when resizing images, which makes sense from a performance point of view, but looks terrible. Better to use a bi-linear or cubic resize, more computing up front, but better images, this is probably the reason they do it
Re:How Discord Resizes 150M Images Every Day with Go and C++ by amelius on Tuesday November 14, 2017 @02:55PM (#15698547)
But soon you can do any type of resizing through WASM on the browser.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by XCSme on Tuesday November 14, 2017 @04:03PM (#15699092)
You can already do it, just use a library or implement your own scaling function and don't use the built-in image resize functions.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by searealist on Tuesday November 14, 2017 @11:24PM (#15701441)
bi-linear is linear interpolation
Re:How Discord Resizes 150M Images Every Day with Go and C++ by nice_byte on Wednesday November 15, 2017 @01:44AM (#15701900)
I think they may have meant "nearest-neighbor", which isn't true for any browsers that I know of.

Regardless, there are still better filters than bilinear, i.e. Lanczos, which I'm pretty sure none of the browsers use.

Re:How Discord Resizes 150M Images Every Day with Go and C++ by trumpeta on Tuesday November 14, 2017 @04:39PM (#15699415)
This is my understanding as well, you could kill a browser trying to do single-threaded bilinear or cubic resize on a sufficiently large image.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by Poefke on Wednesday November 15, 2017 @07:03AM (#15703160)
If you resize the image in steps, with each resize at least 50% of the previous step, you can do a pretty decent approximation of cubic resize using the canvas. Doing this for a year now, we've gotten no complaints and we have designers as clients :)
Re:How Discord Resizes 150M Images Every Day with Go and C++ by SaltyBackendGuy on Tuesday November 14, 2017 @01:41PM (#15697882)
> 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++ by indiandennis on Tuesday November 14, 2017 @01:59PM (#15698063)
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++ by RussianCow on Tuesday November 14, 2017 @02:02PM (#15698104)
Do you have a source? That's a pretty bold claim, and I haven't seen anything else to back that up.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by hintss on Tuesday November 14, 2017 @04:11PM (#15699165)
pretty sure they've directly stated that they're not selling user data
Re:How Discord Resizes 150M Images Every Day with Go and C++ by gruez on Tuesday November 14, 2017 @04:32PM (#15699346)
to be fair, you could say the same of facebook/google. they're not selling the data (giving it to third parties), but they're making money off it.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by Operyl on Tuesday November 14, 2017 @05:47PM (#15699954)
Sure, they serve said data to other authorized users and clients (intended recipients). Name a business that doesn’t do that. ;)
Re:How Discord Resizes 150M Images Every Day with Go and C++ by gruez on Tuesday November 14, 2017 @07:39PM (#15700597)
point is, their statement does not preclude them from using data for marketing purposes. some people are content with that, but others take it as a sign that they are (or will) use the data to build dossiers on users.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by Moru on Tuesday November 14, 2017 @03:04PM (#15698629)
Our site would have been happy with full res images from the start. As it is now we are stuck with 80x80 images that needs replacing with higher res images since the originals was not kept in any sorted order.
Re:How Discord Resizes 150M Images Every Day with Go and C++ by Xeoncross on Tuesday November 14, 2017 @03:23PM (#15698758)
So you kept the originals, but didn't organize them into a way you could use them later?
Re:How Discord Resizes 150M Images Every Day with Go and C++ by Moru on Wednesday November 15, 2017 @09:13AM (#15703813)
Long story but from the start we kept originals organized. Then we restructured and the new people couldnt care less and threw away originals or left them named 1,2,3 and so on. All useless now.