private static BitmapFactory.Options decodeImageForOption(ContentResolver resolver, Uri uri)
      throws FileNotFoundException {
    InputStream stream = null;
    try {
      stream = resolver.openInputStream(uri);
      BitmapFactory.Options options = new BitmapFactory.Options();
      options.inJustDecodeBounds = true;
      BitmapFactory.decodeStream(stream, EMPTY_RECT, options);
      options.inJustDecodeBounds = false;
      return options;
    } finally {
      closeSafe(stream);
    }
  }
Decode image from uri using "inJustDecodeBounds" to get the image dimensions.
core/src/main/java/com/theartofdev/edmodo/cropper/BitmapUtils.java