Hi there I am also trying to implement same functionality. The issue
is when i am image cropper on high slide pop up (this gets open when i
am uploading the image, and this new image comes in to pop up , thus
user uses the crop tool and saves the image).
But when i upload the second image it does not reset the earlier crop
area (PreviewArea, testWrap) i.e. it takes the dimension of previous
image.
I tried using two function
var cropperObject = null;
var getCropperObject = function(imageId, previewAreaId) {
new Cropper.ImgWithPreview(
imageId,
{
minWidth: 175,
minHeight: 120,
ratioDim: { x: 200, y: 120 },
displayOnInit: true,
onEndCrop: onEndCrop,
previewWrap: previewAreaId
}
)
};
function attachCropper ()
{
detachCropper ();
cropperObject = getCropperObject ("testImage", "previewArea");
$("imgCrop_testImage").src = $("testImage").src;
}
function detachCropper ()
{
if(cropperObject)
{
alert("detachCropper");
cropperObject.reset ();
delete cropperObject;
cropperObject = null;
$("imgCrop_testImage").src = "";
$("testWrap").innerHTML = "<img id='testImage' />";
}
}
but it is showing cropperObject is coming out to be undefined so it is
not going in if() condetion....and detachCropper does not work.... I
am trying to resize cropper in run time.
and i m changing src in run time using javascript.
please help me out....thanks a lot.