Hey guys i am trying to crop uploaded image using php using following code.
if(isset($_POST["Crop"])){
$source_x=$_POST['x_value'];
$source_y=$_POST['y_value'];
$width=$_POST['w_value'];
$height=$_POST['h_value'];
$src="assets/images/uploads/1509432972_Koala.jpg";
$crop = imagecreatetruecolor($width,$height);
imagecopy ($crop, $src, 0, 0, $source_x, $source_y, $width, $height);
imagejpeg($crop);
imagedestroy($src);
imagedestroy($crop);
}
The problem that it is not working properly. Since there are lot of posts there to solve this, found a solution called GD library how to include it and crop all kind of images.