I am using Imagemagick for resizing and cropping image.
Test Image :

I need to re-size it for 300 x 320 frame for this first I am resizing the image and then cropping it and i am using the following commands:
exec("convert /uploadImagePath -thumbnail 300 /newImagePath");
exec("convert /newImagePath -gravity Center -crop 290x310+0+0 /newImagePath");
But it gives me following image

As you can see image is not complete. Where am I mistaken?
Try: