How to resize images or files before uploading them ?

Hi !

I am totally new to this forum and also
Vaadin Framework

(and sorry for my English)
.
I can restrict image size from
https://vaadin.com/forum/#!/thread/217117/
. Moreover , I don’t want to restrict and users can upload their images any of size but all of the images were resized into my specific size. Can it be possible ?

For instance , a user uploaded one image with size (1024x768) px. But this image should be save in server side repository with my specific size (400x350) px .

The main point I would like to do is all uploaded images were resized at uploading time.
I would appreciated any suggestions ! thanks …

You should be able to resize images on the server-side with Java’s image processing features, and there are also many image-processing libraries for Java. How you do that is not a matter of Vaadin.

However, resizing the image on the server-side means transmitting them to the server, which can be a problem on slow connections. For client-side resizing, you could use the GWT FileUpload widget, as
described briefly here
, and there is also the
gwt-image-upload
add-on that helps greatly for doing that (see instructions in the previous link).

However, the GWT widget or the image-upload add-on have no server-side integration API, so you’d need to make that. That could be a bit demanding if you’re a new user, but anyhow, that’s the best way to do it.


Hi, Cataclysm.
Have you worked it out? I wonder how can I accomplish the


image resizing process


. Do I need another image resizing SDK to help


customize the size of images

[color=#000000]
? I am almost a green hand here. Any suggestion will be appreciated. Thanks in advance.

Best regards,
Arron
[/color]

Hi, I’m needing to do the same and I can not find the way.
Is there a way to use an Upload and add this JS function?
https://codepen.io/tuanitpro/pen/wJZJbp
thank you very much