PDFLib Centering an Image in a box
===

I would like to center an Image both vertically and horizontally within a box using PDFLib and PHP.

I'm using the following code for this:

    $p->fit_image($image, $xPos,$yPos,"boxsize={".$width." ".$height."} position={center center} fitmethod=clip showborder");

The image center that shows up in my generated pdf is somewhat off (by a few centimeters)
How does PDFLib calculate the center of the Image?