public static void resizeImagePerAspectRatio(View image,int maxHeight,View resizableView){
  if (image == null)   return;
  if (resizableView == null)   return;
  int height=(int)(image.getWidth() / IMAGE_ASPECT_RATIO);
  height=Math.min(height,maxHeight);
  ViewGroup.LayoutParams lp;
  lp=resizableView.getLayoutParams();
  if (lp.height != height) {
    lp.height=height;
    resizableView.setLayoutParams(lp);
  }
}

public static void resizeImagePerAspectRatio ( View image , int maxHeight , View resizableView ) { if ( image == null ) return ; if ( resizableView == null ) return ; int height = ( int ) ( image . getWidth ( ) / IMAGE_ASPECT_RATIO ) ; height = Math . min ( height , maxHeight ) ; ViewGroup . LayoutParams lp ; lp = resizableView . getLayoutParams ( ) ; if ( lp . height != height ) { lp . height = height ; resizableView . setLayoutParams ( lp ) ; } }
resize the resizableview based on a standard aspect ratio , up to a maximum height
