resizeImageFixWidthAndHeight

void sutil.resizeImageFixWidth ( String originalFile, String newFile, int newWidthSize, int newHeightSize, boolean deleteOriginalFile ) (enterprise edition only)

Description

Resize image to a specified size.

Parameters

  • originalFile File path of the image to be resized, as a string.
  • newFile File path when the new image should be created, as a string.
  • newWidthSize The width of the resized image in pixels, as a integer.
  • newHeightSize The height of the resized image in pixels, as a integer.
  • deleteOriginalFile Whether the origionalFile should be retained, as a boolean.

Return Values

Returns void. If an error is encountered it will be thrown.

Change Log

Version Description
5.0 Moved from session to sutil.
4.5 Available for enterprise edition.

This method can cause distortions of the image if the aspect ratio of the original and target images are different.

Examples

Resize Image to Specified Size

 // Resizes a JPG to 100x100 pixels.
 // After the image is resized, the original
 // will be deleted.

 sutil.resizeImageFixWidthAndHeight( "C:/my_image.jpg", "C:/my_image_thumbnail.jpg", 100, 100, true );