lucee.Componentmodels.extendedImage
Extended image component A wrapper for a ColdFusion image object with some extended functionality
Property Summary | ||||
---|---|---|---|---|
type | property | default | serializable | required |
string
|
filename
The filename of the image object.
|
true
|
false
|
|
string
|
height
The height of the image object.
|
true
|
false
|
|
any
|
imageMagickLocation
Set the location of an ImageMagick binary to use this over native Java image resizing.
|
true
|
false
|
|
any
|
imageObject
The image struct.
|
true
|
false
|
|
string
|
mimeType
The mime type of the image object.
|
true
|
false
|
|
string
|
path
The path of the image object.
|
true
|
false
|
|
string
|
src
The source of the image object.
|
true
|
false
|
|
string
|
status
The status of the image object.
|
true
|
false
|
|
string
|
statusDetail
More detail about the status of the image object.
|
true
|
false
|
|
numeric
|
timer
A timer.
|
true
|
false
|
|
string
|
URL
The URL of the image object.
|
true
|
false
|
|
string
|
width
The width of the image object.
|
true
|
false
|
Constructor Summary | |
---|---|
init()
Constructor. |
Method Summary | |
---|---|
any
|
containsImage()
Check that the image object contains an image. |
any
|
createTextImage(string textString, [numeric width='600'], [numeric height='600'], [string canvasColor='000000'], [string textColor='FFFFFF'], [struct attributeCollection='[runtime expression]'])
Create an image containing some text and populate the object with it. |
string
|
getFilename()
|
string
|
getHeight()
|
private any
|
getImageFromFileSystem(string src)
Read an image from the filesystem. |
private any
|
getImageFromURL(string url, [string authenticationString=''])
Read an image from a URL. |
string
|
getImageMagickLocation()
|
string
|
getImageObject()
|
any
|
getImageProperties()
Return image properties. |
any
|
getMemento()
getMemento. |
string
|
getMimeType()
|
string
|
getPath()
|
struct
|
getProportionalSizes(numeric srcWidth, numeric srcHeight, [numeric newWidth='0'], [numeric newHeight='0'])
Given source dimensions and a new width or height, proportionally calculate the missing side. |
string
|
getSrc()
|
string
|
getStatus()
|
string
|
getStatusDetail()
|
string
|
getTimer()
|
string
|
getURL()
|
string
|
getWidth()
|
any
|
outputImage()
Output the image to the browser. |
any
|
readImage(string src, [string authenticationString=''])
Read an image from the filesystem or from a URL. |
any
|
resize(numeric width='0', numeric height='0', [string interpolation='mitchell'], [boolean fixCanvas='false'], [string backgroundColor='FFFFFF'])
Resize the image. |
any
|
setFilename(string filename)
|
any
|
setHeight(string height)
|
any
|
setImageMagickLocation(any imageMagickLocation)
|
any
|
setImageObject(any imageObject)
|
any
|
setMimeType(string mimeType)
|
any
|
setMimeTypeFromExtension(string extension)
setMimeTypeFromExtension. |
any
|
setPath(string path)
|
any
|
setSrc(string src)
|
any
|
setStatus(string status)
|
any
|
setStatusDetail(string statusDetail)
|
any
|
setTimer(numeric timer)
|
any
|
setURL(string URL)
|
any
|
setWidth(string width)
|
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
Constructor
Property Detail |
---|
The filename of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe height of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueSet the location of an ImageMagick binary to use this over native Java image resizing.
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe image struct
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe mime type of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe path of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe source of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe status of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueMore detail about the status of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueA timer
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe URL of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueThe width of the image object
access
- publicrequired
- falsereturntype
- anyserializable
- trueMethod Detail |
---|
Check that the image object contains an image
Create an image containing some text and populate the object with it
textString
- (required) The text to display in the imagewidth
- The width of the new imageheight
- The height of the new imagecanvasColor
- The background colour (hex or r,g,b)textColor
- The colour of the text (hex or r,g,b)attributeCollection
- A struct to be passed to ImageDrawText (https://cfdocs.org/imagedrawtext)Read an image from the filesystem
src
- The location of the imageRead an image from a URL
url
- The url of the imageauthenticationString
- An authentication string if one is required (user:pass)Return image properties
getMemento
Given source dimensions and a new width or height, proportionally calculate the missing side
srcWidth
- (required) Source widthsrcHeight
- (required) Source heightnewWidth
- New widthnewHeight
- New heightOutput the image to the browser. This avoids the need to write the file to the disk or make use of the temporary folder used by `writeToBrowser()`
Read an image from the filesystem or from a URL
src
- (required) The location of the image. May be a filesystem path or a URLauthenticationString
- An authentication string if one is required (user:pass)Resize the image
width
- Desired image widthheight
- Desired image heightinterpolation
- Interpolation to use for the resizingfixCanvas
- When true, fix the canvas size to the specified dimensions, whilst proportionally resizing the content. e.g. You may want to create a uniform square image from a portrait or landscape image.backgroundColor
- When using the fixCanvas method, the resulting image may contain a blank area that should be filled with a colour. (hex or r,g,b)filename
height
imageMagickLocation
imageObject
mimeType
setMimeTypeFromExtension
extension
- (required) the extension of the image filepath
src
status
statusDetail
timer
URL
width