How to get rotation the image from Uri in android?

Get information from a image is it a portrait or landscape?

(Uri) getIntent().getExtras().get(IMAGE_URI);