Upload same image in different sizes - Dropzonejs

401 Views Asked by At

There is any possibility to upload a file with different sizes in DropzoneJs? I'm using vue-dropzone which is made with dropzonejs and i have to upload the same file with different sizing for srcset.

Example: I want to upload the file test.png which is 1000x500 px. There is any possibility to upload it at the same time in original resolution and also in 500x250px?

2

There are 2 best solutions below

0
On BEST ANSWER

Image resizing in the browser has been a seat-of-the pants experience for a long time. Web assemblies are the way of the future for processing-intensive tasks in web apps. I came across this project the other day. It looks fantastic and I really can't wait to strip out our home-baked image resizing with canvas and replace it with this.

The usual reason for doing this is to avoid large uploads. It's a little bit weird to want to resize in the browser then upload the original. You might be better resizing on the server. You'll save bandwidth and the server libraries will be more mature than what's available on the client.

0
On

Along with the original image object you can add one more your custom resized image to the array of images by using resize config of dropzone. You can do the above on drop event or adddedFile event of dropzone.