how do you initiate cropper to crop image in fengyuanchen cropper

744 views Asked by At

I am using the fengyuanchen cropper and am using the crop-avatar example and want to pre-load an image into the cropper on load ready for editing. I.e an image which has already been uploaded to the server.

I have spent hours on this and got no where does anyone know how to do this?

https://github.com/fengyuanchen/cropper/tree/master/examples/crop-avatar

1

There are 1 answers

0
Killilea On

I have done this with pulling the base64 from the server and populating on load.

// Added a class or just load
var $image = $('.img-container > img');

Maybe I'm missing it but, I put the image in 2 spots on for view and one for crop.