public BufferedImage getBufferedImage(int width, int height, int type) {
        int wDif,
                hDif,
                fWidth = 0,
                fHeight = 0;

        double imgWidth,
                imgHeight;

        double factor;
        imgWidth = image.getWidth();
        imgHeight = image.getHeight();


        switch (type) {
            case PROPORTIONAL:
                wDif = (int) imgWidth - width;
                hDif = (int) imgHeight - height;
                if (wDif > hDif) {
                    factor = width / imgWidth;
                } else {
                    factor = height / imgHeight;
                }
                fWidth = (int) Math.floor(imgWidth * factor);
                fHeight = (int) Math.floor(imgHeight * factor);
                break;
        }
        return getBufferedImage(fWidth, fHeight);
    }
public BufferedImage getBufferedImage ( int width , int height , int type ) { int wDif , hDif , fWidth = 0 , fHeight = 0 ; double imgWidth , imgHeight ; double factor ; imgWidth = image . getWidth ( ) ; imgHeight = image . getHeight ( ) ; switch ( type ) { case PROPORTIONAL : wDif = ( int ) imgWidth - width ; hDif = ( int ) imgHeight - height ; if ( wDif > hDif ) { factor = width / imgWidth ; } else { factor = height / imgHeight ; } fWidth = ( int ) Math . floor ( imgWidth * factor ) ; fHeight = ( int ) Math . floor ( imgHeight * factor ) ; break ; } return getBufferedImage ( fWidth , fHeight ) ; }
Resize and return the image passing the new height and width, but maintains width/height factor

@param height
@param width
@return