How do I get image dimensions?

Q: I am dealing with pdf extraction. what I need now are image
dimensions.

The image height and width are given in "samples" I can't see a way to
get from this to the displayed size in mm or even in px.

I am sure there must be a way so I assume I am missing something
obvious. Can you point me in the right direction?
-----

A:

The 'sample' in PDF is essentially the same as pixel (i.e. the picture
element). So you can use image and height properties to find the
dimensions of the source image in pixels. To calculate resolution of
image in device independent units (i.e. image DPI or pixels per mm,
etc) please see the following FAQ:

'How do I get the image resolution and DPI?':