Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | List of all members
eZTemplateImageOperator Class Reference
Template system » Template operators

Text to image conversion using operator "texttoimage". More...

## Public Member Functions
| __construct ( $texttoimageName="texttoimage", $imageName="image", $imagefileName="imagefile")
| operatorTemplateHints ()
| modify ( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$inputValue, $namedParameters, $placement)
| operatorList ()
| namedParameterPerOperator ()
| namedParameterList ()
| fontDir ()
| cacheDir ()
| htmlDir ()
| family ()
| pointSize ()
| angle ()
| xAdjustment ()
| yAdjustment ()
| widthAdjustment ()
| heightAdjustment ()
| useCache ()
| colors ()
| decodeColor ($col)
| color ( $colname)
| setFontDir ( $dir)
| setCacheDir ( $dir)
| setHTMLDir ( $dir)
| setFamily ( $fam)
| setPointSize ( $size)
| setAngle ( $ang)
| setXAdjustment ( $x)
| setYAdjustment ( $y)
| setWidthAdjustment ( $w)
| setHeightAdjustment ( $h)
| setUseCache ( $use)
| setColors ( $cols)
| setColor ( $colname, $colval)
| hasImage ( $dirs, $base, $md5Text, $alternativeText, $imageType)
| storeImage ( $image, $dirs, $base, $md5Text, $alternativeText, $imageType)
| setLoadImage ( $image, $dirs, $base, $md5Text, $alternativeText, $imageType)
| loadImage ( $dirs, $base, $md5Text, $alternativeText, $imageType)
| readImageParameters ( $tpl, $image, $operatorParameters, $rootNamespace, $currentNamespace, &$md5Input, &$alternativeText, $placement)

## Public Attributes
| $WAdjust
| $HAdjust
| $MissingGDFunctions
| $Operators
| $DefaultClass
| The default class to use for text to image conversion. More...
| $FontDir
| the directory were fonts are found, default is "" More...
| $CacheDir
| the directory were cache files are created, default is "" More...
| $HTMLDir
| the directory were html code finds the images, default is "" More...
| $Family
| the default font family, default is "arial" More...
| $PointSize
| the default font point size, default is 12 More...
| $Angle
| the default font angle, default is 0 More...
| $XAdjust
| the default font x adjustment, default is 0 More...
| $YAdjust
| the default font y adjustment, default is 0 More...
| $UseCache
| whether to reuse cache files or not More...
| $Colors
| the color array, default is bgcolor=white and textcolor=black More...
| $ImageGDSupported
| Whether image GD is supported. More...
| $StoreAs = 'png'
| Storage Format, default is "png". More...

## Detailed Description

Text to image conversion using operator "texttoimage".

This operator allows a piece of text be converted to an image file representing the text. The output image is written in PNG format. Use setFontDir() and setCacheDir() to change where the font is located and where the cache file should be put. If fontDir() is an empty string the font will be looked for in the system.

Definition at line 23 of file eztemplateimageoperator.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZTemplateImageOperator::__construct | ( |  | $texttoimageName = `"texttoimage"`,
|  |  | $imageName = `"image"`,
|  |  | $imagefileName = `"imagefile"`
| ) |  |

Initializes the image operator with the operator name $name.

Parameters

  string | $texttoimageName |
  string | $imageName |
  string | $imagefileName |

Definition at line 35 of file eztemplateimageoperator.php.

References eZSys\wwwDir().

## Member Function Documentation

## ◆ angle()

eZTemplateImageOperator::angle | ( |  | ) |

Returns
  the angle at which the font is rendered.

Definition at line 401 of file eztemplateimageoperator.php.

References $Angle.

## ◆ cacheDir()

eZTemplateImageOperator::cacheDir | ( |  | ) |

Returns
  the directory where images are created.

See also
  setCacheDir

Definition at line 366 of file eztemplateimageoperator.php.

References $CacheDir.

## ◆ color()

eZTemplateImageOperator::color | ( |  | $colname | ) |

Returns the decodecd color for colorname $colname

Definition at line 478 of file eztemplateimageoperator.php.

References decodeColor().

Referenced by modify().

## ◆ colors()

eZTemplateImageOperator::colors | ( |  | ) |

Returns
  the array of colors in use

Definition at line 453 of file eztemplateimageoperator.php.

References $Colors.

## ◆ decodeColor()

eZTemplateImageOperator::decodeColor | ( |  | $col | ) |

Takes a mixed mode color representation and decodes it to a an array of three elements which represents the R, G and B color elements.

Parameters

  $col | The mixed color mode

Definition at line 462 of file eztemplateimageoperator.php.

Referenced by color(), and modify().

## ◆ family()

eZTemplateImageOperator::family | ( |  | ) |

Returns
  the family name of the default font.

See also
  setFamily

Definition at line 384 of file eztemplateimageoperator.php.

References $Family.

## ◆ fontDir()

eZTemplateImageOperator::fontDir | ( |  | ) |

Returns
  the directory where fonts are located. If it is empty the font is looked for in the system font dirs.

See also
  setFontDir

Definition at line 357 of file eztemplateimageoperator.php.

References $FontDir.

## ◆ hasImage()

eZTemplateImageOperator::hasImage | ( |  | $dirs,
|  |  | $base,
|  |  | $md5Text,
|  |  | $alternativeText,
|  |  | $imageType
| ) |  |

Definition at line 603 of file eztemplateimageoperator.php.

References eZDir\getPathFromFilename(), eZClusterFileHandler\instance(), and eZDir\path().

Referenced by modify().

## ◆ heightAdjustment()

eZTemplateImageOperator::heightAdjustment | ( |  | ) |

Returns
  the number of pixels the height of the image is adjusted.

See also
  setHeightAdjustment, widthAdjustment

Definition at line 437 of file eztemplateimageoperator.php.

References $HAdjust.

## ◆ htmlDir()

eZTemplateImageOperator::htmlDir | ( |  | ) |

Returns
  the directory where image is accessible from HTML code.

See also
  setHTMLdir

Definition at line 375 of file eztemplateimageoperator.php.

References $HTMLDir.

## ◆ loadImage()

eZTemplateImageOperator::loadImage | ( |  | $dirs,
|  |  | $base,
|  |  | $md5Text,
|  |  | $alternativeText,
|  |  | $imageType
| ) |  |

Definition at line 664 of file eztemplateimageoperator.php.

References eZImageLayer\createForFile(), eZDir\getPathFromFilename(), eZClusterFileHandler\instance(), and eZDir\path().

Referenced by modify().

## ◆ modify()

eZTemplateImageOperator::modify | ( |  | $tpl,
|  |  | $operatorName,
|  |  | $operatorParameters,
|  |  | $rootNamespace,
|  |  | $currentNamespace,
|  | & | $inputValue,
|  |  | $namedParameters,
|  |  | $placement
| ) |  |

Performs image conversion using Image GD and returns the html text for the image.

Definition at line 104 of file eztemplateimageoperator.php.

References $Angle, $Family, $HAdjust, $PointSize, $UseCache, $WAdjust, $XAdjust, $YAdjust, color(), eZImageLayer\createForFile(), eZImageTextLayer\createForText(), decodeColor(), eZImageFont\exists(), hasImage(), loadImage(), readImageParameters(), setLoadImage(), storeImage(), and eZDebug\writeError().

## ◆ namedParameterList()

eZTemplateImageOperator::namedParameterList | ( |  | ) |

See eZTemplateOperator::namedParameterList

Definition at line 306 of file eztemplateimageoperator.php.

## ◆ namedParameterPerOperator()

eZTemplateImageOperator::namedParameterPerOperator | ( |  | ) |

Returns
  true to tell the template engine that the parameter list exists per operator type.

Definition at line 298 of file eztemplateimageoperator.php.

## ◆ operatorList()

eZTemplateImageOperator::operatorList | ( |  | ) |

Returns the operators in this class.

Definition at line 290 of file eztemplateimageoperator.php.

References $Operators.

## ◆ operatorTemplateHints()

eZTemplateImageOperator::operatorTemplateHints | ( |  | ) |

Definition at line 84 of file eztemplateimageoperator.php.

## ◆ pointSize()

eZTemplateImageOperator::pointSize | ( |  | ) |

Returns
  the pointsize of the default font.

See also
  setPointsize

Definition at line 393 of file eztemplateimageoperator.php.

References $PointSize.

## ◆ readImageParameters()

eZTemplateImageOperator::readImageParameters | ( |  | $tpl,
|  |  | $image,
|  |  | $operatorParameters,
|  |  | $rootNamespace,
|  |  | $currentNamespace,
|  | & | $md5Input,
|  | & | $alternativeText,
|  |  | $placement
| ) |  |

Definition at line 689 of file eztemplateimageoperator.php.

References eZImageObject\ALIGN_AXIS_CENTER, eZImageObject\ALIGN_AXIS_NONE, eZImageObject\ALIGN_AXIS_START, eZImageObject\ALIGN_AXIS_STOP, eZImageObject\PLACE_CONSTANT, and eZImageObject\PLACE_RELATIVE.

Referenced by modify().

## ◆ setAngle()

eZTemplateImageOperator::setAngle | ( |  | $ang | ) |

Sets the angle for the default font.

Definition at line 534 of file eztemplateimageoperator.php.

## ◆ setCacheDir()

eZTemplateImageOperator::setCacheDir | ( |  | $dir | ) |

Sets the directory where images are created.

See also
  cacheDir

Definition at line 501 of file eztemplateimageoperator.php.

## ◆ setColor()

eZTemplateImageOperator::setColor | ( |  | $colname,
|  |  | $colval
| ) |  |

Sets the colorname $colname to color value $colval. The colval is a mixed color mode so different values can be input.

See also
  setColors, color

Definition at line 598 of file eztemplateimageoperator.php.

## ◆ setColors()

eZTemplateImageOperator::setColors | ( |  | $cols | ) |

Sets all the colors.

See also
  setColor, color

Definition at line 588 of file eztemplateimageoperator.php.

## ◆ setFamily()

eZTemplateImageOperator::setFamily | ( |  | $fam | ) |

Sets the font family for the default font.

Definition at line 518 of file eztemplateimageoperator.php.

## ◆ setFontDir()

eZTemplateImageOperator::setFontDir | ( |  | $dir | ) |

Sets the font directory, see fontDir() for more information.

See also
  fontDir

Definition at line 492 of file eztemplateimageoperator.php.

## ◆ setHeightAdjustment()

eZTemplateImageOperator::setHeightAdjustment | ( |  | $h | ) |

Adjustment for height.

See also
  widthAdjustment, heightAdjustment, setWidthAdjustment

Definition at line 570 of file eztemplateimageoperator.php.

## ◆ setHTMLDir()

eZTemplateImageOperator::setHTMLDir | ( |  | $dir | ) |

Sets the directory which the HTML code uses to acces the image.

See also
  htmlDir

Definition at line 510 of file eztemplateimageoperator.php.

## ◆ setLoadImage()

eZTemplateImageOperator::setLoadImage | ( |  | $image,
|  |  | $dirs,
|  |  | $base,
|  |  | $md5Text,
|  |  | $alternativeText,
|  |  | $imageType
| ) |  |

Definition at line 640 of file eztemplateimageoperator.php.

References eZDir\getPathFromFilename(), eZClusterFileHandler\instance(), and eZDir\path().

Referenced by modify().

## ◆ setPointSize()

eZTemplateImageOperator::setPointSize | ( |  | $size | ) |

Sets the pointsize for the default font.

Definition at line 526 of file eztemplateimageoperator.php.

## ◆ setUseCache()

eZTemplateImageOperator::setUseCache | ( |  | $use | ) |

Sets whether to reuse cache files or not.

See also
  useCache

Definition at line 579 of file eztemplateimageoperator.php.

## ◆ setWidthAdjustment()

eZTemplateImageOperator::setWidthAdjustment | ( |  | $w | ) |

Adjustment for width.

See also
  widthAdjustment, heightAdjustment, setHeightAdjustment

Definition at line 561 of file eztemplateimageoperator.php.

## ◆ setXAdjustment()

eZTemplateImageOperator::setXAdjustment | ( |  | $x | ) |

Adjustment in the x axis.

See also
  xAdjustment, yAdjustment, setYAdjustment

Definition at line 543 of file eztemplateimageoperator.php.

## ◆ setYAdjustment()

eZTemplateImageOperator::setYAdjustment | ( |  | $y | ) |

Adjustment in the y axis.

See also
  xAdjustment, yAdjustment, setXAdjustment

Definition at line 552 of file eztemplateimageoperator.php.

## ◆ storeImage()

eZTemplateImageOperator::storeImage | ( |  | $image,
|  |  | $dirs,
|  |  | $base,
|  |  | $md5Text,
|  |  | $alternativeText,
|  |  | $imageType
| ) |  |

Definition at line 620 of file eztemplateimageoperator.php.

References eZMimeType\findByURL(), eZDir\getPathFromFilename(), eZClusterFileHandler\instance(), and eZDir\path().

Referenced by modify().

## ◆ useCache()

eZTemplateImageOperator::useCache | ( |  | ) |

Returns
  true if image cache should be reused if the image text etc.. hasn't changed.

Definition at line 445 of file eztemplateimageoperator.php.

References $UseCache.

## ◆ widthAdjustment()

eZTemplateImageOperator::widthAdjustment | ( |  | ) |

Returns
  the number of pixels the width of the image is adjusted.

See also
  setWidthAdjustment, heightAdjustment

Definition at line 428 of file eztemplateimageoperator.php.

References $WAdjust.

## ◆ xAdjustment()

eZTemplateImageOperator::xAdjustment | ( |  | ) |

Returns
  the number of pixels the font is adjusted in the X direction.

See also
  setXAdjustment, yAdjustment

Definition at line 410 of file eztemplateimageoperator.php.

References $XAdjust.

## ◆ yAdjustment()

eZTemplateImageOperator::yAdjustment | ( |  | ) |

Returns
  the number of pixels the font is adjusted in the Y direction.

See also
  setYAdjustment, xAdjustment

Definition at line 419 of file eztemplateimageoperator.php.

References $YAdjust.

## Member Data Documentation

## ◆ $Angle

eZTemplateImageOperator::$Angle

the default font angle, default is 0

Definition at line 842 of file eztemplateimageoperator.php.

Referenced by angle(), and modify().

## ◆ $CacheDir

eZTemplateImageOperator::$CacheDir

the directory were cache files are created, default is ""

Definition at line 834 of file eztemplateimageoperator.php.

Referenced by cacheDir().

## ◆ $Colors

eZTemplateImageOperator::$Colors

the color array, default is bgcolor=white and textcolor=black

Definition at line 850 of file eztemplateimageoperator.php.

Referenced by colors().

## ◆ $DefaultClass

eZTemplateImageOperator::$DefaultClass

The default class to use for text to image conversion.

Definition at line 830 of file eztemplateimageoperator.php.

## ◆ $Family

eZTemplateImageOperator::$Family

the default font family, default is "arial"

Definition at line 838 of file eztemplateimageoperator.php.

Referenced by family(), and modify().

## ◆ $FontDir

eZTemplateImageOperator::$FontDir

the directory were fonts are found, default is ""

Definition at line 832 of file eztemplateimageoperator.php.

Referenced by fontDir().

## ◆ $HAdjust

eZTemplateImageOperator::$HAdjust

Definition at line 26 of file eztemplateimageoperator.php.

Referenced by heightAdjustment(), and modify().

## ◆ $HTMLDir

eZTemplateImageOperator::$HTMLDir

the directory were html code finds the images, default is ""

Definition at line 836 of file eztemplateimageoperator.php.

Referenced by htmlDir().

## ◆ $ImageGDSupported

eZTemplateImageOperator::$ImageGDSupported

Whether image GD is supported.

Definition at line 852 of file eztemplateimageoperator.php.

## ◆ $MissingGDFunctions

eZTemplateImageOperator::$MissingGDFunctions

Definition at line 27 of file eztemplateimageoperator.php.

## ◆ $Operators

eZTemplateImageOperator::$Operators

The operator array

Definition at line 828 of file eztemplateimageoperator.php.

Referenced by operatorList().

## ◆ $PointSize

eZTemplateImageOperator::$PointSize

the default font point size, default is 12

Definition at line 840 of file eztemplateimageoperator.php.

Referenced by modify(), and pointSize().

## ◆ $StoreAs

eZTemplateImageOperator::$StoreAs = 'png'

Storage Format, default is "png".

Definition at line 854 of file eztemplateimageoperator.php.

## ◆ $UseCache

eZTemplateImageOperator::$UseCache

whether to reuse cache files or not

Definition at line 848 of file eztemplateimageoperator.php.

Referenced by modify(), and useCache().

## ◆ $WAdjust

eZTemplateImageOperator::$WAdjust

Definition at line 25 of file eztemplateimageoperator.php.

Referenced by modify(), and widthAdjustment().

## ◆ $XAdjust

eZTemplateImageOperator::$XAdjust

the default font x adjustment, default is 0

Definition at line 844 of file eztemplateimageoperator.php.

Referenced by modify(), and xAdjustment().

## ◆ $YAdjust

eZTemplateImageOperator::$YAdjust

the default font y adjustment, default is 0

Definition at line 846 of file eztemplateimageoperator.php.

Referenced by modify(), and yAdjustment().

The documentation for this class was generated from the following file:

- eztemplateimageoperator.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.