Your English is perfect. Don't apologize for doing your best. Many of us here speak several different languages and empathize.
As for your question, it depends entirely on the image file format. Getting the dimensions of a GIF will be done entirely differently than for a PNG, etc.
You might want to check out ImageMagick, a free-to-use library that understands a zillion image formats. It is available for all major operating systems. http://www.imagemagick.org/
Sorry for my previous post, i just found my answer, if you are interested then it's called Magick++ based on imagemagick, if i understood correctly, then it is a lib.