code: 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;
  		}
  	}
docs: Resize the given image.
  
  @param originalImage
  the original image
  @param scalingMethod
  the scaling method
  @param resizeMode
  the resize mode
  @param formatName
  the format name
  @param targetWidth
  the target width
  @param targetHeight
  the target height
  @return the byte[]