code: public static BufferedImage resize(BufferedImage src, int targetSize,
  			BufferedImageOp... ops) throws IllegalArgumentException,
  			ImagingOpException {
  		return resize(src, Method.AUTOMATIC, Mode.AUTOMATIC, targetSize,
  				targetSize, ops);
  	}
docs: Resize a given image (maintaining its original proportion) to a width and
  height no bigger than <code>targetSize</code> and apply the given
  {@link BufferedImageOp}s (if any) to the result before returning it.
  <p/>
  A scaling method of {@link Method#AUTOMATIC} and mode of
  {@link Mode#AUTOMATIC} are used.
  <p/>
  <strong>TIP</strong>: This operation leaves the original <code>src</code>
  image unmodified. If the caller is done with the <code>src</code> image
  after getting the result of this operation, remember to call
  {@link BufferedImage#flush()} on the <code>src</code> to free up native
  resources and make it easier for the GC to collect the unused image.
  
  @param src
  The image that will be scaled.
  @param targetSize
  The target width and height (square) that you wish the image
  to fit within.
  @param ops
  <code>0</code> or more optional image operations (e.g.
  sharpen, blur, etc.) that can be applied to the final result
  before returning the image.
  
  @return a new {@link BufferedImage} representing the scaled
  <code>src</code> image.
  
  @throws IllegalArgumentException
  if <code>src</code> is <code>null</code>.
  @throws IllegalArgumentException
  if <code>targetSize</code> is &lt; 0.
  @throws ImagingOpException
  if one of the given {@link BufferedImageOp}s fails to apply.
  These exceptions bubble up from the inside of most of the
  {@link BufferedImageOp} implementations and are explicitly
  defined on the imgscalr API to make it easier for callers to
  catch the exception (if they are passing along optional ops
  to be applied). imgscalr takes detailed steps to avoid the
  most common pitfalls that will cause {@link BufferedImageOp}s
  to fail, even when using straight forward JDK-image
  operations.