|
|
|
|
|
by ino
2985 days ago
|
|
Will we ever have a way to tell the browser engine to shrink images to some maximum dimensions before uploading them to the server, without javascript? Is there any work being done in that direction? Javascript implementations like Pica - http://nodeca.github.io/pica/demo/ are slow even with wasm.
It'd also be nice not to rely on javascript for such fundamental things. |
|
use the `drawImage` function to draw the image scaled to whatever size you want, then just call any of the APIs that you want to get either ImageData, a base64-encoded-URI, or a PNG Blob resized.
The exact method of resize is up to the useragent (IIRC i could be wrong on this), and it's done in "native" code, not in javascript.