CFIMAGE
CFIMAGE is a tag that allows you to modify an existing GIF, PNG or JPEG image file to produce a new image file that is resized and/or has a text label added to he image. Variables returned by this tag provide information about the new image file
Usage
<cfimage>
Attributes
Attribute | default | required | summary |
---|---|---|---|
ATTRIBUTECOLLECTION | A structure containing the tag attributes | ||
SRCFILE | ![]() |
The file name of the source image file that is to be modified. Can be either a full physical path or a relative path (see the URIDirectory attribute). | |
DESTFILE | Required if ACTION=EDIT,CROP,ROTATE,BORDER,GRAYSCALE, Optional if ACTION=INFO. The file name of the new image file to be created by the CFIMAGE tag. Can be either a full physical path or a relative path (see the URIDirectory attribute). | ||
ACTION | EDIT | The action to be taken by the CFIMAGE tag. Valid values are 'EDIT', 'INFO', 'CROP', 'ROTATE', 'BORDER' and 'GRAYSCALE'. The value INFO populates the CFIMAGE variables with information about the image file specified by the srcFile attribute without modifying the image. The value of EDIT creates a new image file by resizing and/or adding a text label to the source image file. The value of CROP will crop the image., The value of ROTATE will rotate an image., The action of BORDER will put a border around an image., The action of GRAYSCALE will aplly a grayscale filter to the image. | |
TYPE | The image file type, either GIF, PNG or JPEG. If this attribute is not specified, the CFIMAGE tag attempts to determine the image type based on the file name extension. | ||
WIDTH | 100% | The width of the new image, can be specified either in pixels or as a percentage of the source image width. Required if ACTION=CROP | |
HEIGHT | 100% | The height of the new image, can be specified either in pixels or as a percentage of the source image height. Required if ACTION=CROP | |
X | ![]() |
For ACTION=CROP, the starting X position for the crop | |
Y | ![]() |
For ACTION=CROP, the starting Y position for the crop | |
ANGLE | For ACTION=ROTATE the angle to which to rotate the image. Expressed in degrees | ||
FONTSIZE | 12 | An integer value that specified the font size of the text label to be added to the image | |
FONTCOLOR | black | Specifies the font color of the text label to be added to the image. Accepts any value that is valid for use in the FONT tag. | |
COLOR | black | The color of the border or text | |
THICKNESS | 1 | The thickness of the border | |
CONTRAST | The value to which to adjust the contrast of the image by | ||
BRIGHTNESS | The value to which to adjust the brightness of the image by | ||
TEXT | The text label to add to the image | ||
POSITION | The position of the text label to add to the image; valid valued are 'north' and 'south'. Defaults to 'south'. | ||
NAMECONFLICT | error | Indicates the behavior of the CFIMAGE tag when the file specified by destFile already exists. Valid values are ERROR, which generates a runtime error; SKIP, which causes the CFIMAGE tag to do nothing without generating an error; OVERWRITE, to overwrite the existing image; and, MAKEUNIQUE, which causes CFIMAGE to create a new unique file name for the new image file | |
URIDIRECTORY | no | If YES, relative paths specified in srcFile and destFile are calculated from the web server document root directory. If NO, relative paths are calculated as relative to the current file. |