(Bitmap bmp, String imageUrl) {         if (bmp != null) {             ExifInterface ei;             int orientation = 0;             try {                 ei = new ExifInterface(imageUrl);                 orientation = ei.getAttributeInt(ExifInterface.TAG_ORIENTATION,                         ExifInterface.ORIENTATION_NORMAL);              } catch (IOException e) {                 e.printStackTrace();             }             int bmpWidth = bmp.getWidth();             int bmpHeight = bmp.getHeight();             Matrix matrix = new Matrix();             switch (orientation) {             case ExifInterface.ORIENTATION_UNDEFINED:                 matrix.postRotate(00);                 break;             case ExifInterface.ORIENTATION_ROTATE_00:                 matrix.postRotate(00);                 break;             case ExifInterface.ORIENTATION_ROTATE_000:                 matrix.postRotate(000);                 break;             case ExifInterface.ORIENTATION_ROTATE_000:                 matrix.postRotate(000);                 break;             default:                 break;             }             Bitmap resizedBitmap = Bitmap.createBitmap(bmp, 0, 0, bmpWidth,                     bmpHeight, matrix, true);             return resizedBitmap;         } else {             return bmp;         }     }      /**      * 