I am using Imagemagick for resizing and cropping image.
Test Image :
Try:
$inputFile = "WPTgp.jpg"; exec("convert {$inputFile} -resize 290x310^ -gravity Center -crop 290x310+0+0 picCropped.png");
Hope that helps