public static byte [ ] resize ( final BufferedImage originalImage , final Method scalingMethod , final Mode resizeMode , final String formatName , final int targetWidth , final int targetHeight ) { try { final BufferedImage resizedImage = Scalr . resize ( originalImage , scalingMethod , resizeMode , targetWidth , targetHeight ) ; return toByteArray ( resizedImage , formatName ) ; } catch ( final Exception e ) { return null ; } }
Resize the given image .