Image Upload Client-side Compression

Hi all, is there a way to resize / compress an image client side before uploading to the server?

With the standard implementation of Upload it will take the full size image - which I can compress server side - but for slow connections this can take a very long time, especially with the resolution of modern smartphone cameras

It’s likely possible, but tricky. You’d need to use a JavaScript image compression library to do the compression first. Google finds several matches, but I can’t vouch for any specific one. Then there’s the part that you’d need to hook the compression to the upload. I’d look into the web-components/packages/upload/src/vaadin-upload.js at main · vaadin/web-components · GitHub _onFileStart event for that purpose.