ImageCFC: Documentation: Method Description

imageCFC.filterFastBlur()

Description

Applies a simple blur filter to an image.

Returns

A structure containing the following fields:

keyvalue
errorCode0 for success, non-zero for failure. Always returned, but not really used if the throwOnError option is set to true.
errorMessageA description of the error. Always returned, but not really used if the throwOnError option is set to true.
imgA java BufferedImage object is returned if no output file is specified

History

Added to image.cfc version 2.10

Function Syntax

filterFastBlur(objImage,inputFile,outputFile,blurAmount,iterations,jpegCompression)

ParameterRequired?DefaultDescription
objImage YES - A java image object, or a blank string.
inputFile YES - File path or URL to an image, or a blank string.
outputFile YES - File path to write the output, or a blank string.
blurAmount YES - The amount of the blur (a positive integer). NOTE: Keep this number small, as this method cannot handle blurring the edges of an image, based on the blur amount. If the blur amount is 10, then the outer 10 pixels of the image will not be blurred.
iterations YES - How many times to perform the blur (a positive integer) NOTE: Don't overdo it! Applying this blur method many times will lead to edge distortion.
jpegCompression NO defaultJpegCompression jpeg compression quality to use if writing a jpeg file. 0-100. 100 is the highest quality.

You must supply either an image object or a file path to a source image.

Example

<cfset imageCFC = createObject("component","image")>
<cfset imgInfo = imageCFC.filterFastBlur("", "C:\Inetpub\wwwroot\myimage.jpg", "C:\Inetpub\wwwroot\myimage2.jpg",1,5)>
<img src="myimage2.jpg" alt="filtered image"/>


Please read this project's LICENSE

This is an open source project written by Rick Root. Please visit The Coldfusion Open Source Blog for more information.

Please report bugs, make suggestions, and send compliments to me via email.