I am trying to translate the following piece of Imagemagick command line code
convert tmpI.mpc -gravity center -crop ${ww}x${hc}+0+0 +repage
as follows
$tmpIC->setGravity(imagick::GRAVITY_CENTER);
$tmpIC->cropImage($ww, $hc, 0, 0);
$tmpIC->setImagePage($tmpIC->getImageWidth(), $tmpIC->getImageHeight(), 0, 0);
but setting or not setting the gravity makes no difference. Please tell me what is wrong with the piece of code I have
Width and Height of the image before cropping are
tmpIC->getImageWidth() = 479
tmpIC->getImageHeight() = 599
And the values of ww and hc are
ww=479
hc=479
and the width and height of the image after cropping are as follows
tmpIC->getImageWidth() = 479
tmpIC->getImageHeight() = 479