-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #253 from mjhagen/master
cfimage examples
- Loading branch information
Showing
1 changed file
with
198 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,205 @@ | ||
{ | ||
"name":"cfimage", | ||
"type":"tag", | ||
"syntax":"<cfimage>", | ||
"returns":"", | ||
"related":[], | ||
"description":" Creates a ColdFusion image that can be manipulated by using Image functions.\n You can use the cfimage tag to perform common image manipulation operations as a shortcut to Image functions.\n You can use the cfimage tag independently or in conjunction with Image functions.", | ||
"name": "cfimage", | ||
"type": "tag", | ||
"syntax": "<cfimage>", | ||
"returns": "", | ||
"related": [], | ||
"description": "Creates a ColdFusion image that can be manipulated by using image functions.\nYou can use the cfimage tag to perform common image manipulation operations as a shortcut to Image functions.\nYou can use the cfimage tag independently or in conjunction with image functions.", | ||
"params": [ | ||
{"name":"action","description":"The action to take. Must be one of the following:\n border\n captcha\n convert\n info\n read\n resize\n rotate\n write\n writeToBrowser\n You do not need to specify the default action, read, explicitly. (optional, default=read)","required":false,"default":"","type":"String","values":["border","captcha","convert","info","read","resize","rotate","write","writeToBrowser"]}, | ||
{"name":"angle","description":"Angle in degrees to rotate the image.\n You must specify an integer for the value. (required)","required":false,"default":"","type":"Numeric","values":[]}, | ||
{"name":"color","description":"(border) Border color.\n Hexadecimal value or supported named color.\n For a hexadecimal value, use the form \"##xxxxxx\" or \"xxxxxx\". (required)","required":false,"default":"","type":"String","values":[]}, | ||
{"name":"destination","description":"Absolute or relative pathname where the image output is written.\n The image format is determined by the file extension.\n The convert and write actions require a destination.\n The border, captcha, resize, and rotate actions require either a name attribute or a destination attribute.\n You can specify both.\n Scorpio supports only CAPTCHA images in PNG format.\n If you do not enter a destination, the CAPTCHA image is placed inline in the HTML output and displayed in the web browser. (optional)","required":false,"default":"","type":"String","values":[]}, | ||
{"name":"difficulty","description":"Level of complexity of the CAPTCHA text.\n Specify one of the following levels of text distortion:\n high\n medium\n low (optional, default=low)","required":false,"default":"","type":"String","values":["high","medium","low"]}, | ||
{"name":"fontSize","description":"Font size of the text in the CAPTCHA image.\n The value must be an integer. (optional)","required":false,"default":"","type":"Numeric","values":[]}, | ||
{"name":"format","description":"Format of the image displayed in the browser.\n If you do not specify a format, the image is displayed in PNG format.\n You cannot display a GIF image in a browser.\n GIF images are displayed in PNG format. (optional, Default=PNG)","required":false,"default":"","type":"String","values":["PNG","jpg","jpeg"]}, | ||
{"name":"height","description":"Height in pixels of the image.\n For the resize attribute, you also can specify the height as a percentage (an integer followed by the \"%\" symbol).\n The value must be an integer. (optional)","required":false,"default":"","type":"Numeric","values":[]}, | ||
{"name":"isBase64","description":"Specifies whether the source is a Base64 string.\n The isBase64 values are:\n yes: the source is a Base64 string.\n no: the source is not a Base64 string. (optional, default=no)","required":false,"default":"","type":"Boolean","values":[true,false]}, | ||
{"name":"name","description":"Name of the ColdFusion image variable to create.\n The read action requires name attribute.\n The border, resize, and rotate options require a name attribute or a destination attribute.\n You can specify both. (optional)","required":false,"default":"","type":"String","values":[]}, | ||
{"name":"overwrite","description":"Valid only if the destination attribute is specified. The overwrite values are:\n yes: overwrites the destination file.\n no: does not overwrite the destination file.\n If the destination file already exists, ColdFusion generates an error if the overwrite option is not set to yes. (optional, default=no)","required":false,"default":"","type":"Boolean","values":[true,false]}, | ||
{"name":"quality","description":"Quality of the JPEG destination file.\n Applies only to files with an extension of JPG or JPEG.\n Valid values are fractions that range from 0 through 1\n (the lower the number, the lower the quality). (optional, default=0.75)","required":false,"default":"","type":"Numeric","values":[]}, | ||
{"name":"source","description":"URL of the source image; for example, \"http:\/\/www.google.com\/ images\/logo.gif\"\n Absolute or relative pathname of the source image; for example, \"c:\\wwwroot\\images\\logo.jpg\"\n ColdFusion image variable containing another image, BLOB, or byte array; for example, \"#myImage#\" \n Base64 string; for example, \"data:image\/jpg;base64,\/9j\/ 4AAQSkZJRgABAQA..............\" (required)","required":false,"default":"","type":"Any","values":[]}, | ||
{"name":"structName","description":"() Name of the ColdFusion structure to be created. (required)","required":false,"default":"","type":"String","values":[]}, | ||
{"name":"text","description":"Text string displayed in the CAPTCHA image.\n Use capital letters for better readability. (required)","required":false,"default":"","type":"String","values":[]}, | ||
{"name":"thickness","description":"Border thickness in pixels.\n The border is added to the outside edge of the source image,\n increasing the image area accordingly.\n The value must be an integer. (optional, default=1)","required":false,"default":"","type":"Numeric","values":[]}, | ||
{"name":"width","description":"Width in pixels of the image.\n For resize, you also can specify the width as a percentage\n (an integer followed by the \"%\" symbol).\n The value must be an integer. (required)","required":false,"default":"","type":"String","values":[]}, | ||
{"name":"fonts","description":"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.","required":false,"default":"","type":"String","values":[]} | ||
|
||
{ | ||
"name": "action", | ||
"description": "The action to take. Must be one of the following:\nborder\ncaptcha\nconvert\ninfo\nread\nresize\nrotate\nwrite\nwriteToBrowser\nYou do not need to specify the default action, read, explicitly.", | ||
"required": false, | ||
"default": "read", | ||
"type": "String", | ||
"values": [ "border", "captcha", "convert", "info", "read", "resize", "rotate", "write", "writeToBrowser" ] | ||
}, | ||
{ | ||
"name": "angle", | ||
"description": "Angle in degrees to rotate the image.", | ||
"required": false, | ||
"default": "", | ||
"type": "Numeric", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "color", | ||
"description": "(border) Border color.\nHexadecimal value or supported named color.\nFor a hexadecimal value, use the form \"##xxxxxx\" or \"xxxxxx\". (required)", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "destination", | ||
"description": "Absolute or relative pathname where the image output is written.\nThe image format is determined by the file extension.\nThe convert and write actions require a destination.\nThe border, captcha, resize, and rotate actions require either a name attribute or a destination attribute.\nYou can specify both.\nScorpio supports only CAPTCHA images in PNG format.\nIf you do not enter a destination, the CAPTCHA image is placed inline in the HTML output and displayed in the web browser.", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "difficulty", | ||
"description": "Level of complexity of the CAPTCHA text.\nSpecify one of the following levels of text distortion:\nhigh\nmedium\nlow", | ||
"required": false, | ||
"default": "low", | ||
"type": "String", | ||
"values": [ "high", "medium", "low" ] | ||
}, | ||
{ | ||
"name": "fontSize", | ||
"description": "Font size of the text in the CAPTCHA image.\nThe value must be an integer.", | ||
"required": false, | ||
"default": "", | ||
"type": "Numeric", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "format", | ||
"description": "Format of the image displayed in the browser.\nIf you do not specify a format, the image is displayed in PNG format.\nYou cannot display a GIF image in a browser.\nGIF images are displayed in PNG format.", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [ "png", "jpg", "jpeg" ] | ||
}, | ||
{ | ||
"name": "height", | ||
"description": "Height in pixels of the image.\nFor the resize attribute, you also can specify the height as a percentage (an integer followed by the \"%\" symbol).\nThe value must be an integer.", | ||
"required": false, | ||
"default": "", | ||
"type": "Numeric", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "isBase64", | ||
"description": "Specifies whether the source is a Base64 string.\nThe isBase64 values are:\nyes: the source is a Base64 string.\nno: the source is not a Base64 string.", | ||
"required": false, | ||
"default": "false", | ||
"type": "Boolean", | ||
"values": [ true, false ] | ||
}, | ||
{ | ||
"name": "name", | ||
"description": "Name of the ColdFusion image variable to create.\nThe read action requires name attribute.\nThe border, resize, and rotate options require a name attribute or a destination attribute.\nYou can specify both.", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "overwrite", | ||
"description": "Valid only if the destination attribute is specified. The overwrite values are:\nyes: overwrites the destination file.\nno: does not overwrite the destination file.\nIf the destination file already exists, ColdFusion generates an error if the overwrite option is not set to yes.", | ||
"required": false, | ||
"default": "false", | ||
"type": "Boolean", | ||
"values": [ true, false ] | ||
}, | ||
{ | ||
"name": "quality", | ||
"description": "Quality of the JPEG destination file.\nApplies only to files with an extension of JPG or JPEG.\nValid values are fractions that range from 0 through 1\n(the lower the number, the lower the quality).", | ||
"required": false, | ||
"default": "0.75", | ||
"type": "Numeric", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "source", | ||
"description": "URL of the source image; for example, \"http://www.google.com/ images/logo.gif\"\nAbsolute or relative pathname of the source image; for example, \"c:\\wwwroot\\images\\logo.jpg\"\nColdFusion image variable containing another image, BLOB, or byte array; for example, \"#myImage#\" \nBase64 string; for example, \"data:image/jpg;base64,/9j/ 4AAQSkZJRgABAQA..............\"", | ||
"required": false, | ||
"default": "", | ||
"type": "Any", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "structName", | ||
"description": "() Name of the ColdFusion structure to be created.", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "text", | ||
"description": "Text string displayed in the CAPTCHA image.\nUse capital letters for better readability.", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "thickness", | ||
"description": "Border thickness in pixels.\nThe border is added to the outside edge of the source image,\nincreasing the image area accordingly.\nThe value must be an integer.", | ||
"required": false, | ||
"default": "1", | ||
"type": "Numeric", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "width", | ||
"description": "Width in pixels of the image.\nFor resize, you also can specify the width as a percentage\n(an integer followed by the \"%\" symbol).\nThe value must be an integer.", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [] | ||
}, | ||
{ | ||
"name": "fonts", | ||
"description": "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.", | ||
"required": false, | ||
"default": "", | ||
"type": "String", | ||
"values": [] | ||
} | ||
], | ||
"engines": { | ||
"coldfusion": {"minimum_version":"", "notes":"", "docs":"https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-i/cfimage.html"}, | ||
"lucee": {"minimum_version":"", "notes":"", "docs":"http://docs.lucee.org/reference/tags/image.html"}, | ||
"railo": {"minimum_version":"", "notes":"", "docs":"http://railodocs.org/index.cfm/tag/cfimage"}, | ||
"openbd": {"minimum_version":"", "notes":"", "docs":"http://openbd.org/manual/?/tag/cfimage"} | ||
"coldfusion": { | ||
"minimum_version": "", | ||
"notes": "", | ||
"docs": "https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-i/cfimage.html" | ||
}, | ||
"lucee": { | ||
"minimum_version": "", | ||
"notes": "", | ||
"docs": "http://docs.lucee.org/reference/tags/image.html" | ||
}, | ||
"railo": { | ||
"minimum_version": "", | ||
"notes": "", | ||
"docs": "http://railodocs.org/index.cfm/tag/cfimage" | ||
}, | ||
"openbd": { | ||
"minimum_version": "", | ||
"notes": "", | ||
"docs": "http://openbd.org/manual/?/tag/cfimage" | ||
} | ||
}, | ||
"links": [ | ||
"links": [], | ||
"examples": [ | ||
{ "title": "Border action", "description": "Add a red border of 5 pixels to an image, write the output to a variable.", | ||
"code": "<cfimage action=\"border\" source=\"#sourceImage#\" size=5 color=\"red\" name=\"withborder\">" }, | ||
|
||
] | ||
{ "title": "Captcha action", "description": "Generate a CAPTCHA style image using medium difficulty.", | ||
"code": "<cfimage action=\"captcha\" text=\"Captcha!\" difficulty=\"medium\" fontSize=\"18\" fonts=\"Comic Sans MS,Times New Roman\">" }, | ||
|
||
{ "title": "Convert action", "description": "Convert an image to a different format (in this case PNG).", | ||
"code": "<cfimage action=\"convert\" source=\"#sourceImage#\" destination=\"#expandPath( 'destination.png' )#\" overwrite=\"true\">" }, | ||
|
||
{ "title": "Info action", "description": "Retrieve meta data from an image and stores that as a structure in a variable.", | ||
"code": "<cfimage action=\"info\" source=\"#sourceImage#\" structname=\"imageInfo\">" }, | ||
|
||
{ "title": "Read action", "description": "Tag syntax for reading an image from a URL.", | ||
"code": "<cfimage action=\"read\" name=\"sourceImage\" source=\"http://www.example.com/myImage.jpg\">" }, | ||
|
||
} | ||
{ "title": "Resize action", "description": "Example of resizing an image stored in a variable and storing the result in a variable.", | ||
"code": "<cfimage action=\"resize\" source=\"#sourceImage#\" height=\"200\" width=\"200\" name=\"resized\">" }, | ||
|
||
{ "title": "Rotate action", "description": "Rotate an image 30 degrees clockwise.", | ||
"code": "<cfimage action=\"rotate\" source=\"#sourceImage#\" destination=\"#expandPath( 'rotated.jpg' )#\" overwrite=\"true\" angle=\"30\" quality=\"1\">" }, | ||
|
||
{ "title": "Write action", "description": "Example of writing an image as an 80% compressed jpg image.", | ||
"code": "<cfimage action=\"write\" source=\"#sourceImage#\" destination=\"#expandPath( 'newImage.jpg' )#\" overwrite=\"true\" quality=\".2\">" }, | ||
|
||
{ "title": "WriteToBrowser action", "description": "Generates HTML to output the image in place.", | ||
"code": "<cfimage action=\"writeToBrowser\" source=\"#sourceImage#\">" } | ||
] | ||
} |