public Image scaledHeight(int height){
  float ratio=((float)height) / ((float)getHeight());
  return scaled(Math.max(1,(int)(getWidth() * ratio)),height);
}

public Image scaledHeight ( int height ) { float ratio = ( ( float ) height ) / ( ( float ) getHeight ( ) ) ; return scaled ( Math . max ( 1 , ( int ) ( getWidth ( ) * ratio ) ) , height ) ; }
scales the image to the given height while updating the width based on the aspect ratio of the height
