private static Bitmap resizePhoto(Bitmap realImage,float maxImageSize,boolean filter){
  float ratio=Math.min((float)maxImageSize / realImage.getWidth(),(float)maxImageSize / realImage.getHeight());
  int width=Math.round((float)ratio * realImage.getWidth());
  int height=Math.round((float)ratio * realImage.getHeight());
  Bitmap newBitmap=Bitmap.createScaledBitmap(realImage,width,height,filter);
  return newBitmap;
}

private static Bitmap resizePhoto ( Bitmap realImage , float maxImageSize , boolean filter ) { float ratio = Math . min ( ( float ) maxImageSize / realImage . getWidth ( ) , ( float ) maxImageSize / realImage . getHeight ( ) ) ; int width = Math . round ( ( float ) ratio * realImage . getWidth ( ) ) ; int height = Math . round ( ( float ) ratio * realImage . getHeight ( ) ) ; Bitmap newBitmap = Bitmap . createScaledBitmap ( realImage , width , height , filter ) ; return newBitmap ; }
this method resize the photo
