Cropper crop multiple Images before upload with dropzne js

3.2k views Asked by At

I'm using Bootstrap with dropzone.js to enable that users can upload images by drag & drop. Therefore, I created a drop zone which is working fine including the upload even with multiple images. But now, I want to crop the images before I upload them. I think the this.on("added file", function(file){ Event in the init function of dropzone.js is the right place, but I don't know how to convert the files so that I can crop them one by one in a special model and upload the cropped image.

1

There are 1 answers

1
nivas On

You can access the uploaded file in dropzone within "addedFile" but if you want to crop images uploaded via dropzone you have to use external lbrary such as cropperjs. first if you have multi upload in dropzone then give a button to every image or add a click event to every image and pass that file as param to cropperjs.