I have the follow PHP code:
$w = 300; // Width of new image
$h = 300; // Height of new image
$oh = 540; // Original file height
$ow = 720; // Original file width
$x = 196;
$y = 50;
$image = imagecreatefromjpeg('fileToCrop.jpg');
$cropped_image = imagecreatetruecolor($w, $h);
imagecopyresampled($cropped_image, $image, 0, 0, $x, $y, $ow, $oh, $w, $h);
imagejpeg($cropped_image, 'fileToCrop.jpg', 100);
And want to crop the image, but my images are distorting / higher than original, eg:
Original:

Cropped (“N” for “Not” are showing):

I can’t see what is wrong with my code, and what are happening to images goes bigger..
You inverted the last 4 parameters of
imagecopyresampledChange it for
But in fact, are you sure you’re not looking for a straight copy of the cropped region?