imagefile

Summary

Loads an image from a file.

Usage

imagefile( filename )

Parameters

NameTypeDescriptionRequired
filename string Name of image file to load. Yes.

Returns

Image layer.

Description

This operator simply loads an image from the filesystem and returns it as an image layer. The layer can be used as a parameter to the "image" operator, which basically takes care of merging images.

For each image layer, the following information can be retrieved:

Attribute        Type

-------------------------

filepath         string

filename         string

width            integer

height           integer

alternative_text string

imagepath        string

has_size         boolean

If the "has_size" parameter is set to false then the width and height parameters will contain "false" instead of zero-valued integers.

If the operator is called directly (see example 1), the specified image will be displayed using a template that is associated with the image layer. This is the "/design/standard/image/layer.tpl" template. It is possible to override this template using the template override system.

The imagefile operator does not make use of an input parameter.

Examples

Example 1

{imagefile( '/design/my_design/images/test.jpg' )}

This will load "test.jpg" from the specified directory. Note: instead of hardcoding the path (like in the example above), the ezimage operator should be used instead. Since the operator is called directly, the template system will insert the layer template in order to display the image directly.

Example 2

{let test=imagefile( '/design/my_design/images/test.jpg' )}

{$test|attribute( show )}

{/let}

returns the following:

Attribute        Type    Value

--------------------------------

filepath         string  '/design/my_company/images'

filename         string  'test.jpg'

width            boolean false

height           boolean false

alternative_text string  'test'

imagepath        string  '/design/my_company/images/test.jpg'

has_size         boolean false

Comments

Contents

Reference

Database diagram
Template operators
    PDF
    Arrays
    Data extraction
    Formatting
    Images
       image
       imagefile
       texttoimage
    Logic
    Mathematics
    Miscellaneous
    Strings
    URLs
    Variables
Template functions
Data fetching
Modules
XML tags


Created

05/02/2004
11:38:02 am
by Balazs Halasy

Last updated

11/02/2004
11:42:24 pm
by Balazs Halasy

Authors

Balazs Halasy



This page is part of the Exponential documentation. The documentation is available under the GNU Free Documentation License. All contributions will be released under the terms of this license.