imageUtilities

imageUtilities

imageUtilities

Require ColdFusion 6.1 or above

Metadata

fCalculateRatioWidth()

returns new width based on max width and maintaining width/height ratio

Arguments

Name Type Required Default Options Description
originalWidth numeric Yes New width (pixels). Default to 100
originalHeight numeric Yes New width (pixels). Default to 100
maxWidth numeric Yes maximum allowabe width
maxHeight numeric Yes maximum allowabe height

fCreateDefaultDirectories()

creates the default image directories for original, optimised and thumbnail

Arguments

Name Type Required Default Options Description
None

fCreateDirectory()

creates a directory based on the path

Arguments

Name Type Required Default Options Description
directoryPath string Yes a directory to create

fCreatePresets()

Create image presets for image content item.

Arguments

Name Type Required Default Options Description
imagePreset string Yes options are: thumbnailsImage & standardImage (default: thumnailImage)
originalFile string Yes Absolute path to source image (including image name)
destinationFile string No Absolute path to new resized image (including image name) [Optional]

fGetDefaultDestinationFilePath()

returns file as a java image object

Arguments

Name Type Required Default Options Description
originalFile string Yes Path to the image
filenameSuffix string No _rendered the name of image eg. originalname_SUFFIX.xxx

fGetProperties()

Get properties for image file.

Arguments

Name Type Required Default Options Description
originalFile string Yes Path to the image

fRead()

returns file as a java image object

Arguments

Name Type Required Default Options Description
originalFile string Yes Path to the image

fResize()

resize the image to a certain width

Arguments

Name Type Required Default Options Description
originalFile string Yes Path to the image
destinationFile string No Resized image path, either local or absolute
maxWidth numeric No 100 New width (pixels). Default to 100
maxHeight numeric No 100 New width (pixels). Default to 100