Contents

cfimage

Description

Lets you resize and add labels to GIF and JPEG format images.

Category

Other

Implemented

Usage Syntax

<cfimage  
	[action="String"]
	[angle="number"]
	[color="String"]
	[destination="String"]
	[difficulty="String"]
	[fonts="String"]
	[fontSize="number"]
	[format="String"]
	[height="String"]
	[isBase64="Boolean"]
	[name="String"]
	[overwrite="Boolean"]
	[quality="number"]
	[source="Any"]
	[structName="String"]
	[result="String"]
	[text="String"]
	[thickness="number"]
	[width="String"]
 />

[] = Optional attribute

Attributes

Name Type Required Default Description
action String No Action to execute. Must be one of the following: border, captcha, convert, info, read, resize, rotate, write, writeToBrowser The default action is read, which you do not need to specify explicitly.
angle number No Angle in degrees to rotate the image.
color String No Border color. Hexadecimal value or supported named color. For a hexadecimal value, use the form "#xxxxxx" or "xxxxxx", where x = 0-9 or A-F; use two number signs or none.
destination String No Absolute or relative pathname where the image output is written. The image format is determined by the file extension. The convert and write actions require a destination attribute. The border, captcha, resize, and rotate actions require a name attribute or a destination attribute. You can specify both. If you do not enter a destination, the CAPTCHA image is placed inline in the HTML output and displayed in the web browser.
difficulty String No Level of complexity of the CAPTCHA text. Specify one of the following levels of text distortion: low, medium, high
fonts String No One or more valid fonts to use for the CAPTCHA text. Separate multiple fonts with commas. ColdFusion supports only the system fonts that the JDK can recognize. For example, TTF fonts in the Windows directory are supported on Windows.
fontSize number No font size of the text in the CAPTCHA image.
format String No Format of the image displayed in the browser. If you do not specify a format, the image is displayed in PNG format.
height String No Height in pixels of the image. For the resize attribute, you also can specify the height as a percentage. When you resize an image, if you specify a value for the width.
isBase64 Boolean No Specifies whether the source is a Base64 string
name String No Name of the image variable to create. The read action requires a name attribute. The border, resize, and rotate actions require a name attribute or a destination attribute. You can specify both.
overwrite Boolean No If the destination file already exists, ColdFusion generates an error if the overwrite action is not set to yes.
quality number No Quality of the JPEG destination file. Applies only to files with an extension of JPG or JPEG. Valid values are fractions that range from 0 through 1 (the lower the number, the lower the quality).
source Any No source file
structName String No Name of the ColdFusion structure to be created.
result String No Name of the ColdFusion structure to be created (alias for structname).
text String No Text string displayed in the CAPTCHA image. Use capital letters for better readability. Do not include spaces because users cannot detect them in the resulting CAPTCHA image.
thickness number No Border thickness in pixels. The border is added to the outside edge of the source image, increasing the image area accordingly.
width String No Width in pixels of the image.

Example Usage