I am using jCrop to crop an image. This code was working in another page before, but when I implemented it for a different page it seems to be playing up.
When I run this, the code pics up the original image, squashes it down and then fits the entire image into the box I was intending on cropping to.
The values are coming back from jCrop correctly in the $_POST values.
$origURL=$_POST['CelebrityPicURL'];
$x = $_POST['x'];
$y = $_POST['y'];
$w = $_POST['w'];
$h = $_POST['h'];
$targ_w = $targ_h = 300;
$jpeg_quality = 90;
$img_r = imagecreatefromjpeg($origURL);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
imagecopyresampled($dst_r,$img_r,0,0,$_POST['x'],$_POST['y'],
$targ_w,$targ_h,$_POST['w'],$_POST['h']);
imagejpeg($dst_r,$origURL,$jpeg_quality);