0
jCrop을 사용하여 이미지를 자릅니다. 이 코드는 이전에 다른 페이지에서 작동했지만 다른 페이지에 대해 구현했을 때 재생되는 것으로 보입니다.PHP에서 이미지 자르기 imagecopyresampled - 자르기 대신 스쿼시 처리
이 코드를 실행하면 코드가 원본 이미지를 촬영하고 아래로 축소 한 다음 전체 이미지를 자르려고하는 상자에 맞 춥니 다.
값은 $ _POST 값에서 jCrop에서 올바르게 되돌려지고 있습니다.
$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);