I\'m trying to crop an image using Jcrop, but when I use jqueryrotate on the image, something weird happens.
I rotate the image 90 degress then I activate the JCrop,
I used Dan's approach as a jumping off point but I don't have enough reputation to leave a comment on Dan Baker's answer so I'm submitting another answer. His mouseAbs function didn't work for me at all, I modified it as follows:
function mouseAbs(e)
{
switch (options.rotate) {
case 90:
return [(e.pageY - docOffset[1]), -(e.pageX - docOffset[0])];
case 180:
return [-(e.pageX - docOffset[0]), -(e.pageY - docOffset[1])];
case 270:
return [-(e.pageY - docOffset[1]), (e.pageX - docOffset[0])];
default:
return [(e.pageX - docOffset[0]), (e.pageY - docOffset[1])];
}
}
Everything else was the same. Passed in the current rotation to the Jcrop object when it was initialized and I applied Dan's rotation css class to the .jcrop-holder element.