I am having a strange issue while cropping an image with JCrop and class.upload.php. I am not getting the image cropped as per the selection. , I am working based on this demo http://deepliquid.com/projects/Jcrop/demos/crop.php. I am using the below code to get the co ordinates using JCrop:
function updateCoords(c)
{
$('#x').val(c.x);
$('#y').val(c.y);
$('#w').val(c.x2);
$('#h').val(c.y2);
};
and I am posting these values to crop.php and using this code to crop the image (the code in the demos source is not working (saying deprecated), so I downloaded the latest class.upload.php file from net and wrote the below as per their documentation:
$handle->image_precrop = array(intval($_POST['y']), intval($_POST['w']),intval($_POST['h']), intval($_POST['x']));