How can i get cropped image to display in img ? Can u give sample code.
Thank You.
$('img').cropper('getCroppedCanvas');
or
$('img').cropper('getCroppedCanvas', {width: 100, height: 100});
it only return :
<canvas width="200" height="200"></canvas>
it don't show image.
It return the Canvas element. With canvas you can extract the image data with toDataURL() method.
Do this test:
var imageData = $('img').cropper('getCroppedCanvas').toDataURL();
$('<img>').attr('src', imageData).appendTo('body');
I was facing an issue when I was ruing code as an html file, issue was
cropper-in-modal-Rauf.html:110 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.

Found solution here:
https://stackoverflow.com/a/22716873/2114413
Now I can show results in preview image

Most helpful comment
It return the Canvas element. With canvas you can extract the image data with toDataURL() method.
Do this test: