• News
  • Developer information
  • Projects & contributions
  • Forum
  • Issue tracker
  • Open Funding
  • Security
  • User groups
  • Support
  • Store
  • Company

  • Path

    ez.no / exponential / documentation / development / libraries / ez template / operators / image handling


    Image handling

    These documentation pages are no longer maintained. Please visit the new documentation site.

    Image handling operators

    These operators require the ImageMagick and/or ImageGD extension to work.

    image

    Creates and returns an image by flattening the image layers given as parameters. (This requires the ImageMagick or the ImageGD extension.)
    If a parameter is text it will be used as the alternative text.
    If the parameter is an array it will assume that the first element (0) is the image layer, and the second is a hash table with parameters for that layer.
    The parameters that can be set are:
    - transparency: float value from 0 to 1.0 (ie 0-100%)
    - halign: horizontal alignment, use left, right or center
    - valign: vertical alignment, use top, bottom or center
    - x: absolute placement (works with left and right align)
    - y: absolute placement (works with top and bottom align)
    - xrel: relative placement, float value from 0 to 1.0. (works with left and right align)
    - xrel: relative placement, float value from 0 to 1.0. (works with top and bottom align)
    The x and xrel parameters cannot be used at the same time (same with y and yrel).
    When right or bottom alignment is used, the coordinate system will shift to accommodate the alignment.
    This is useful for doing alignment and placement since the placement is relative to the current coordinate system. Right alignment will start the axis at the right (0) and go on to the left (width).
    Bottom alignment will start the axis at the bottom (0) and go on to the top (height).

    Example:
    Merge two images:

    {image(imagefile('image1.png'|ezimage),imagefile('image2.png'|ezimage))}

    Texttoimage:

    {'Exponential'|texttoimage('arial')}

    Similar to above but now wrapped in an image object:

    {image('Exponential'|texttoimage('arial'))}

    Loads image from file to display as layer:

    {imagefile('var/cache/texttoimage/church.jpg')}

    Creates image object with one file image layer:

    {image(imagefile('var/cache/texttoimage/church.jpg'))}

    Creates image object with 80% transparent text aligned in the top right corner:

    {image("church",
    
          imagefile('var/cache/texttoimage/church.jpg'),
    
          array('Exponential'|texttoimage,
    
                hash(transparency,0.8,
    
                     halign,right,
    
                     valign,top)))}

    Comments

    Tip: Using curly braces

    If you want to show the curly braces in an image generated via texttoimage make sure to not use the wash operator at the same time as it will cause all sorts of problems. For example this code will work:
    {concat('{ ', $node_name, ' }')|texttoimage( 'nav_header' )}

    This will not:
    {concat('{ ', $node_name, ' }')|wash|texttoimage( 'nav_header' )}
    nor will:
    {concat('{literal}{{/literal} ', $node_name, ' {literal}}{/literal}')|wash|texttoimage( 'nav_header' )}

    Alex

    Don't get it..

    > assume that the first element (0) is the image layer
    {image("church",

    church is the layer?

    > the second is a hash table for that layer
    imagefile('var/cache/texttoimage/church.jpg'),

    that seems to be the image layer?!

    Contents

    Development

    Extensions
    Exponential datamodel
    Exponential tuning and stability
    Importing attribute data
    Kernel
    Libraries
        eZ xml
        eZ db
        eZ i18n
        eZ soap
        eZ template
           Basics
           Functions
           Operators
              Data fetch
              String handling
              Type handling
              Logical handling
              Arithmetics
              Control structure handling
              Array handling
              Image handling
              Miscellaneous
        eZ webdav
    Scripting
    Standards
    System overview
    Test Suite
    Using Doxygen to create API documenta...


    Created

    07/07/2003
    3:35:31 pm
    by Bård Farstad

    Last updated

    10/07/2003
    2:47:15 pm
    by Jan Borsodi

    Authors

    Bård Farstad
    Jan Borsodi



    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.