Can I find out the image size?

I’ve created a shortcode based on this example from the documentation that inserts the width and height into the html. (But for that they still need to be looked up and typed in manually.)