models

Class extendedImage

lucee.Component
    extended by models.extendedImage

Extended image component A wrapper for a ColdFusion image object with some extended functionality

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Gary Stanton
  •  
    Property Summary
    type property default serializable required
    string filename
          The filename of the image object.

    • access = public
    • returntype = any
    true false
    string height
          The height of the image object.

    • access = public
    • returntype = any
    true false
    any imageMagickLocation
          Set the location of an ImageMagick binary to use this over native Java image resizing.

    • access = public
    • returntype = any
    true false
    any imageObject
          The image struct.

    • access = public
    • returntype = any
    true false
    string mimeType
          The mime type of the image object.

    • access = public
    • returntype = any
    true false
    string path
          The path of the image object.

    • access = public
    • returntype = any
    true false
    string src
          The source of the image object.

    • access = public
    • returntype = any
    true false
    string status
          The status of the image object.

    • access = public
    • returntype = any
    true false
    string statusDetail
          More detail about the status of the image object.

    • access = public
    • returntype = any
    true false
    numeric timer
          A timer.

    • access = public
    • returntype = any
    true false
    string URL
          The URL of the image object.

    • access = public
    • returntype = any
    true false
    string width
          The width of the image object.

    • access = public
    • returntype = any
    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

    init

    public init()

    Constructor


    Property Detail

    filename

    property string filename

    The filename of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    height

    property string height

    The height of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    imageMagickLocation

    property any imageMagickLocation

    Set the location of an ImageMagick binary to use this over native Java image resizing.

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    imageObject

    property any imageObject

    The image struct

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    mimeType

    property string mimeType

    The mime type of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    path

    property string path

    The path of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    src

    property string src

    The source of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    status

    property string status

    The status of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    statusDetail

    property string statusDetail

    More detail about the status of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    timer

    property numeric timer

    A timer

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    URL

    property string URL

    The URL of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    width

    property string width

    The width of the image object

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    Method Detail

    containsImage

    public any containsImage()

    Check that the image object contains an image

    Returns:
    boolean

    createTextImage

    public 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

    Parameters:
    textString - (required) The text to display in the image
    width - The width of the new image
    height - The height of the new image
    canvasColor - 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)
    Returns:
    image object

    getFilename

    public string getFilename()


    getHeight

    public string getHeight()


    getImageFromFileSystem

    private any getImageFromFileSystem(string src)

    Read an image from the filesystem

    Parameters:
    src - The location of the image
    Returns:
    this

    getImageFromURL

    private any getImageFromURL(string url, [string authenticationString=''])

    Read an image from a URL

    Parameters:
    url - The url of the image
    authenticationString - An authentication string if one is required (user:pass)
    Returns:
    this

    getImageMagickLocation

    public string getImageMagickLocation()


    getImageObject

    public string getImageObject()


    getImageProperties

    public any getImageProperties()

    Return image properties


    getMemento

    public any getMemento()

    getMemento


    getMimeType

    public string getMimeType()


    getPath

    public string getPath()


    getProportionalSizes

    public 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

    Parameters:
    srcWidth - (required) Source width
    srcHeight - (required) Source height
    newWidth - New width
    newHeight - New height

    getSrc

    public string getSrc()


    getStatus

    public string getStatus()


    getStatusDetail

    public string getStatusDetail()


    getTimer

    public string getTimer()


    getURL

    public string getURL()


    getWidth

    public string getWidth()


    outputImage

    public any outputImage()

    Output 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()`


    readImage

    public any readImage(string src, [string authenticationString=''])

    Read an image from the filesystem or from a URL

    Parameters:
    src - (required) The location of the image. May be a filesystem path or a URL
    authenticationString - An authentication string if one is required (user:pass)
    Returns:
    this

    resize

    public any resize(numeric width='0', numeric height='0', [string interpolation='mitchell'], [boolean fixCanvas='false'], [string backgroundColor='FFFFFF'])

    Resize the image

    Parameters:
    width - Desired image width
    height - Desired image height
    interpolation - Interpolation to use for the resizing
    fixCanvas - 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)

    setFilename

    public any setFilename(string filename)

    Parameters:
    filename

    setHeight

    public any setHeight(string height)

    Parameters:
    height

    setImageMagickLocation

    public any setImageMagickLocation(any imageMagickLocation)

    Parameters:
    imageMagickLocation

    setImageObject

    public any setImageObject(any imageObject)

    Parameters:
    imageObject

    setMimeType

    public any setMimeType(string mimeType)

    Parameters:
    mimeType

    setMimeTypeFromExtension

    public any setMimeTypeFromExtension(string extension)

    setMimeTypeFromExtension

    Parameters:
    extension - (required) the extension of the image file

    setPath

    public any setPath(string path)

    Parameters:
    path

    setSrc

    public any setSrc(string src)

    Parameters:
    src

    setStatus

    public any setStatus(string status)

    Parameters:
    status

    setStatusDetail

    public any setStatusDetail(string statusDetail)

    Parameters:
    statusDetail

    setTimer

    public any setTimer(numeric timer)

    Parameters:
    timer

    setURL

    public any setURL(string URL)

    Parameters:
    URL

    setWidth

    public any setWidth(string width)

    Parameters:
    width