1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
$targ_w = $_POST['w']*5;
$targ_h = $_POST['h']*5;
$jpeg_quality = 100;
$src = "xl.jpg";
$img_r = imagecreatefromjpeg($src);
$dst_r = ImageCreateTrueColor( $targ_w, $targ_h );
imagecopyresampled($dst_r,$img_r,0,0,$_POST['x']*5,$_POST['y']*5,
$targ_w,$targ_h,$_POST['w']*5,$_POST['h']*5);
imagejpeg($dst_r,"xl_crop.jpg",$jpeg_quality);
imagedestroy($dst_r,"xl_crop.jpg",$jpeg_quality);
echo '
<script language="Javascript">
window.location="crop_image.php?file='.$_GET["file"].'&&step=3";
</script>';
} |
Partager