I've been coding for over 20 years now! (WOAH, do I feel old)
I've touched just about every resource imaginable under the Sun (too bad they were bought out by Oracle)
Something to consider is that there are countless different resizing algorithms out there. By relying on the browser's canvas resize, you lose this level of control. Lanczos is what I decided on for quality when I built an image hosting web site. It would be possible to reimplement this using JavaScript, but it would be a considerably sized library for clients to download, and probably perform very poorly using Canvas manipulation.
I guess this would be a good use case for a lazily loaded WebAssembly module then. Make (or use an existing) Lanczos compression WASM module, load it on the page when the user begins selecting the file, when file is selected, pass in the image binary to the WASM function, and use the compressed result.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Something to consider is that there are countless different resizing algorithms out there. By relying on the browser's canvas resize, you lose this level of control. Lanczos is what I decided on for quality when I built an image hosting web site. It would be possible to reimplement this using JavaScript, but it would be a considerably sized library for clients to download, and probably perform very poorly using Canvas manipulation.
That is great to know! I haven't heard of Lanczos, I will definitely look into it.
I guess this would be a good use case for a lazily loaded WebAssembly module then. Make (or use an existing) Lanczos compression WASM module, load it on the page when the user begins selecting the file, when file is selected, pass in the image binary to the WASM function, and use the compressed result.