com.tle.web.scripting.advanced.objects
Interface ImagesScriptObject
Declaration: public interface ImagesScriptObject extends ScriptObject
All Superinterfaces: ScriptObject, java.io.Serializable

 

Referenced by the 'images' variable in script.

 

 

Fields Summary
static java.lang.String DEFAULT_VARIABLE
    

 

 

Methods Summary
abstract java.awt.Dimension getDimensions(java.lang.String path)
    
Get the dimensions of the image found at path.
abstract void resize(java.lang.String path, int newWidth, int newHeight, java.lang.String newPath)
    
Creates a new image from an existing image with new dimensions.

 

Methods inherited from interface: com.tle.common.scripting.ScriptObject
scriptEnter, scriptExit

 

 

 

 

DEFAULT_VARIABLE

 

public static final java.lang.String DEFAULT_VARIABLE

 

See also: Constants

 

 

 

 

getDimensions

 

public abstract java.awt.Dimension getDimensions( java.lang.String path)
throws java.io.IOException

 

Get the dimensions of the image found at path.

 

Parameters:
path-
The file path to the image, relative to the item
Returns:
A Dimension object with a getWidth() and a getHeight() method
Throws:
java.io.IOException - If there were problems getting the dimensions of the image, e.g. there is no file at path or the image was in an unrecognised format.

 

 

 

resize

 

public abstract void resize( java.lang.String path,
int newWidth,
int newHeight,
java.lang.String newPath)
throws java.io.IOException

 

Creates a new image from an existing image with new dimensions.

 

Parameters:
path-
The file path to the image to resize, relative to the item
newWidth-
The width of the new image
newHeight-
The height of the new image
newPath-
The file path to the image to create, relative to the item
Throws:
java.io.IOException - If there were problems resizing the image, e.g. there is no file at path or the image was in an unrecognised format.