Java tutorial
//package com.java2s; import android.media.ExifInterface; public class Main { public static int[] getBitmapRealSize(int[] size, int orientation) { if (size == null || size.length != 2) { size = new int[2]; return size; } int w = size[0]; int h = size[1]; switch (orientation) { case ExifInterface.ORIENTATION_ROTATE_270: case ExifInterface.ORIENTATION_ROTATE_90: size[0] = h; size[1] = w; break; } return size; } }