I am trying to crop an image to cicle using the Croppie Library
I have tried to use their functions to return base64 encoded image. And it return a base64 code but without the image: Here is my code:
<div id="vanilla-demo"></div>
</div>
<img id="myImage" src="">
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="croppie.js"></script>
<script type="text/javascript">
var vanilla = new Croppie(document.getElementById('vanilla-demo'), {
viewport: { width: 200, height: 200 , type:'circle'},
boundary: { width: 400, height: 400 },
showZoom: false
});
vanilla.bind('dac.jpg');
vanilla.result('canvas','original').then(function (src) {
console.log(src);
$('#myImage').attr('src', src);
});
</script>