resizeImageFixWidth
void sutil.resizeImageFixWidth ( String originalFile, String newFile, int newWidthSize, boolean deleteOriginalFile ) (enterprise edition only)
Description
Resize image, retaining aspect ratio, based on specified width.
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.
- 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. |
Examples
Resize Image to Specified Width
// Resizes a JPG to 100 pixels wide, maintaining the
// aspect ratio. After the image is resized, the original
// will be deleted.
sutil.resizeImageFixWidth( "C:/my_image.jpg", "C:/my_image_thumbnail.jpg", 100, true );