public ImageHandlerBuilder resizeToWidth ( int size ) { if ( image . getWidth ( ) < size ) return this ; BufferedImage resize = Scalr . resize ( image , Scalr . Mode . FIT_TO_WIDTH , size ) ; image . flush ( ) ; image = resize ; return this ; }
Resize the image to a given width maintaining the original proportions of the image and setting the height accordingly . If the width of the image is smaller than the provided size then the image is not scaled .