I have got this image :
And i need to crop the top and bottom, so i will get this :
I was searching for a while, but did not find a solution, it needs to be done in PHP.
I have got this image :
And i need to crop the top and bottom, so i will get this :
I was searching for a while, but did not find a solution, it needs to be done in PHP.
You can use imagecrop() method to crop any image as follows:
$filename = 'test.JPG';
$image = imagecreatefromjpeg($filename );
$x_size = getimagesize($filename)[0];
$y_size = getimagesize($filename)[1];
$crop_measure = min($x_size, $y_size);
header('Content-Type: image/jpeg');
$crop_array = array('x' =>0 , 'y' => 0, 'width' => $crop_measure, 'height'=> $crop_measure);
$thumb_image = imagecrop($image, $crop_array);