If the image is locally stored you can do the following
public long getImageLength(String absFileName)
{
File file = new File(absFileName);
return file.length();
}
/**
* From "https://mcmap.net/q/27045/-get-pick-an-image-from-android-39-s-built-in-gallery-app-programmatically"
* uri - data stored in an Intent returned from an application such as Gallery or Camera
*/
private String getAbsPath(Uri uri)
{
String[] projection = { MediaStore.Images.Media.DATA };
Cursor cursor = managedQuery(uri, projection, null, null, null);
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}