Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
eZImageHandler Class Referenceabstract
Image conversion and scaling

The class eZImageHandler does. More...

Inheritance diagram for eZImageHandler:

## Public Member Functions
| __construct ( $handlerName, $isEnabled=true, $outputRewriteType=self::REPLACE_SUFFIX, $supportedInputMIMETypes=false, $supportedOutputMIMETypes=false, $conversionRules=false, $filters=false, $mimeTagMap=false)
| isAvailable ()
| tagForMIMEType ( $mimeData)
| supportedImageFilters ()
| conversionRules ()
| textForFilter ( $filterData)
| rewriteURL ( $originalMimeData, &$destinationMimeData, $rewriteType, $aliasName=false)
| supportedInputMIMETypes ()
| supportedOutputMIMETypes ()
| isOutputMIMETypeSupported ( $mimeData)
| isInputMIMETypeSupported ( $mimeData)
| outputMIMEType (&$manager, $currentMimeData, $wantedMimeData, $supportedFormatsOriginal, $aliasName=false)
| outputRewriteType ()
| isFilterSupported ( $filter)
| convert ( $manager, $sourceMimeData, &$destinationMimeData, $filters=false)

## Static Public Member Functions
static | createFilterDefinitionFromINI ( $filterText)
static | convertFilterToText ( $filterDefinition, $filterData)
static | changeFilePermissions ( $filepath)
static | wildcardToRegexp ( $wildcard, $separatorCharacter=false)

## Public Attributes
| $HandlerName
| $SupportedInputMIMETypes
| $SupportedOutputMIMETypes
| $ConversionRules
| $OutputRewriteType
| $Filters
| $FilterMap
| $SupportImageFilters
| $MIMETagMap
| $IsEnabled
const | KEEP_SUFFIX = 1
const | REPLACE_SUFFIX = 2
const | PREPEND_TAG_REPLACE_SUFFIX = 3

## Detailed Description

The class eZImageHandler does.

Definition at line 18 of file ezimagehandler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZImageHandler::__construct | ( |  | $handlerName,
|  |  | $isEnabled = `true`,
|  |  | $outputRewriteType = `self::REPLACE_SUFFIX`,
|  |  | $supportedInputMIMETypes = `false`,
|  |  | $supportedOutputMIMETypes = `false`,
|  |  | $conversionRules = `false`,
|  |  | $filters = `false`,
|  |  | $mimeTagMap = `false`
| ) |  |

Initializes the image handler with data sent from the inheriting class.

Parameters

  string | $handlerName | The name of the current handler
  bool | $isEnabled | A boolean which tells whether the handler can be used or not
  int | $outputRewriteType | Defines how output filenames are rewritten
  array | bool | $supportedInputMIMETypes | A list of MIME-Types the handler supports as input or `false` if no type as defined
  | array|$supportedOutputMIMETypes | A list of MIME-Types the handler supports as output or `false` if no type as defined
  array | bool | $conversionRules | A list of conversion rules specific for this handler, is combined with the global rules
  array | bool | $filters | A list of filters this handler supports
  array | bool | $mimeTagMap | A mapping table which maps from a MIME-Type to a specific tag, this tag can be used when rewriting the filename.

Reimplemented in eZImageShellHandler.

Definition at line 49 of file ezimagehandler.php.

## Member Function Documentation

## ◆ changeFilePermissions()

static eZImageHandler::changeFilePermissions | ( |  | $filepath | ) |
| static

Changes the file permissions for image file $filepath to the ones defines in image.ini. It uses the group FileSettings and variable ImagePermissions.

Returns
  `true` on success, `false` otherwise

Definition at line 257 of file ezimagehandler.php.

References eZDebug\writeError().

Referenced by eZImageGDHandler\convert(), and eZImageShellHandler\convert().

## ◆ conversionRules()

eZImageHandler::conversionRules | ( |  | ) |

Returns
  The conversion rules for this handler.

Definition at line 119 of file ezimagehandler.php.

References $ConversionRules.

Referenced by outputMIMEType().

## ◆ convert()

eZImageHandler::convert | ( |  | $manager,
|  |  | $sourceMimeData,
|  | & | $destinationMimeData,
|  |  | $filters = `false`
| ) |  |
| pure virtual

Converts the source file $sourceMimeData to the destination file $destinationMimeData. If $filters is supplied then the filters will be applied to the conversion.

Implemented in eZImageShellHandler, and eZImageGDHandler.

Definition at line 461 of file ezimagehandler.php.

## ◆ convertFilterToText()

static eZImageHandler::convertFilterToText | ( |  | $filterDefinition,
|  |  | $filterData
| ) |  |
| static

Converts a filter definition and filter data into a text string. This string is usually the commandline parameter.

Definition at line 147 of file ezimagehandler.php.

References eZSys\createShellArgument().

Referenced by textForFilter().

## ◆ createFilterDefinitionFromINI()

static eZImageHandler::createFilterDefinitionFromINI | ( |  | $filterText | ) |
| static

Parses the filter text $filterText which is taken from an INI file and returns a filter definition structure for it.

Definition at line 128 of file ezimagehandler.php.

Referenced by eZImageShellHandler\createFromINI().

## ◆ isAvailable()

eZImageHandler::isAvailable | ( |  | ) |

Returns
  whether this handler can be used or not.

Implementors of image handlers should implement this to return true if the image conversion system to be used is available, for instance to check for a PHP extension.

Note
  default is to return `true`.

Definition at line 85 of file ezimagehandler.php.

References $IsEnabled.

## ◆ isFilterSupported()

eZImageHandler::isFilterSupported | ( |  | $filter | ) |

Returns
  `true` if the filter $filter is supported by this handler.

Definition at line 451 of file ezimagehandler.php.

## ◆ isInputMIMETypeSupported()

eZImageHandler::isInputMIMETypeSupported | ( |  | $mimeData | ) |

Returns
  `true` if the MIME-Type defined in $mimeData is supported as input by this handler.

Definition at line 326 of file ezimagehandler.php.

References supportedInputMIMETypes(), and wildcardToRegexp().

Referenced by outputMIMEType().

## ◆ isOutputMIMETypeSupported()

eZImageHandler::isOutputMIMETypeSupported | ( |  | $mimeData | ) |

Returns
  `true` if the MIME-Type defined in $mimeData is supported as output by this handler.

Definition at line 299 of file ezimagehandler.php.

References supportedOutputMIMETypes(), and wildcardToRegexp().

Referenced by outputMIMEType().

## ◆ outputMIMEType()

eZImageHandler::outputMIMEType | ( | & | $manager,
|  |  | $currentMimeData,
|  |  | $wantedMimeData,
|  |  | $supportedFormatsOriginal,
|  |  | $aliasName = `false`
| ) |  |

Figures out the output MIME type for the $currentMimeData. It goes trough all conversion rules for this handler and returns a MIME structure for the possible output. The returned structure also contains the correct url for the output.

Parameters

  $wantedMimeData | an optional MIME structure for the wanted output type, if a direct conversion rule exists from $currentMimeData to $wantedMimeData then this is used.
  $aliasName | An optional name for the current alias being used, if supplied the output MIME structure will have the alias name in the filename.

Definition at line 360 of file ezimagehandler.php.

References conversionRules(), eZMimeType\findByName(), isInputMIMETypeSupported(), isOutputMIMETypeSupported(), outputRewriteType(), rewriteURL(), and wildcardToRegexp().

## ◆ outputRewriteType()

eZImageHandler::outputRewriteType | ( |  | ) |

Returns
  the type of filename rewrite this handler uses for output.

Definition at line 443 of file ezimagehandler.php.

References $OutputRewriteType.

Referenced by outputMIMEType().

## ◆ rewriteURL()

eZImageHandler::rewriteURL | ( |  | $originalMimeData,
|  | & | $destinationMimeData,
|  |  | $rewriteType,
|  |  | $aliasName = `false`
| ) |  |

Rewrites the URL in $originalMimeData to become a url for $destinationMimeData. The type of rewrite is determined by $rewriteType which can be one of:

- self::KEEP_SUFFIX - Does nothing to the url
- self::REPLACE_SUFFIX - Replaces the suffix or the url
- self::PREPEND_TAG_REPLACE_SUFFIX - Prepends the tag name and replaces the suffix of the url The new url is placed in the $destinationMimeData.

Definition at line 186 of file ezimagehandler.php.

References KEEP_SUFFIX, PREPEND_TAG_REPLACE_SUFFIX, REPLACE_SUFFIX, and tagForMIMEType().

Referenced by outputMIMEType().

## ◆ supportedImageFilters()

eZImageHandler::supportedImageFilters | ( |  | ) |

Returns
  an array with the names of the filters this handler can work with.

Definition at line 111 of file ezimagehandler.php.

References $SupportImageFilters.

## ◆ supportedInputMIMETypes()

eZImageHandler::supportedInputMIMETypes | ( |  | ) |

Returns
  an array with MIME type names that the handler supports as input. MIME type names can also be specified with wildcards, for instance image/* to say that all image types are supported.

Note
  The default implementation returns the MIME types specified in the constructor

Definition at line 235 of file ezimagehandler.php.

References $SupportedInputMIMETypes.

Referenced by isInputMIMETypeSupported().

## ◆ supportedOutputMIMETypes()

eZImageHandler::supportedOutputMIMETypes | ( |  | ) |

Returns
  an array with MIME type names that the handler supports as output. MIME type names can also be specified with wildcards, for instance image/* to say that all image types are supported.

Note
  The default implementation returns the MIME types specified in the constructor

Definition at line 246 of file ezimagehandler.php.

References $SupportedOutputMIMETypes.

Referenced by isOutputMIMETypeSupported().

## ◆ tagForMIMEType()

eZImageHandler::tagForMIMEType | ( |  | $mimeData | ) |

Returns
  the tag for the MIME type named $mimeName. This is a helper function for some shell based handlers, it will create a proper name from the MIME type $mimeData.

Note
  The default returns the type part of the MIME type.

Definition at line 96 of file ezimagehandler.php.

Referenced by eZImageShellHandler\convert(), and rewriteURL().

## ◆ textForFilter()

eZImageHandler::textForFilter | ( |  | $filterData | ) |

Calls convertFilterToText with the correct filter definition and returns the text.

Definition at line 167 of file ezimagehandler.php.

References convertFilterToText().

Referenced by eZImageShellHandler\convert().

## ◆ wildcardToRegexp()

static eZImageHandler::wildcardToRegexp | ( |  | $wildcard,
|  |  | $separatorCharacter = `false`
| ) |  |
| static

Creats a regexp string out of the wildcard $wilcard and returns it.

Definition at line 277 of file ezimagehandler.php.

Referenced by isInputMIMETypeSupported(), isOutputMIMETypeSupported(), outputMIMEType(), and eZImageManager\wildcardToRegexp().

## Member Data Documentation

## ◆ $ConversionRules

eZImageHandler::$ConversionRules

Definition at line 26 of file ezimagehandler.php.

Referenced by conversionRules().

## ◆ $FilterMap

eZImageHandler::$FilterMap

Definition at line 29 of file ezimagehandler.php.

## ◆ $Filters

eZImageHandler::$Filters

Definition at line 28 of file ezimagehandler.php.

## ◆ $HandlerName

eZImageHandler::$HandlerName

Definition at line 23 of file ezimagehandler.php.

## ◆ $IsEnabled

eZImageHandler::$IsEnabled

Definition at line 32 of file ezimagehandler.php.

Referenced by isAvailable().

## ◆ $MIMETagMap

eZImageHandler::$MIMETagMap

Definition at line 31 of file ezimagehandler.php.

## ◆ $OutputRewriteType

eZImageHandler::$OutputRewriteType

Definition at line 27 of file ezimagehandler.php.

Referenced by outputRewriteType().

## ◆ $SupportedInputMIMETypes

eZImageHandler::$SupportedInputMIMETypes

Definition at line 24 of file ezimagehandler.php.

Referenced by supportedInputMIMETypes().

## ◆ $SupportedOutputMIMETypes

eZImageHandler::$SupportedOutputMIMETypes

Definition at line 25 of file ezimagehandler.php.

Referenced by supportedOutputMIMETypes().

## ◆ $SupportImageFilters

eZImageHandler::$SupportImageFilters

Definition at line 30 of file ezimagehandler.php.

Referenced by supportedImageFilters().

## ◆ KEEP_SUFFIX

const eZImageHandler::KEEP_SUFFIX = 1

Definition at line 33 of file ezimagehandler.php.

Referenced by rewriteURL().

## ◆ PREPEND_TAG_REPLACE_SUFFIX

const eZImageHandler::PREPEND_TAG_REPLACE_SUFFIX = 3

Definition at line 35 of file ezimagehandler.php.

Referenced by rewriteURL().

## ◆ REPLACE_SUFFIX

const eZImageHandler::REPLACE_SUFFIX = 2

Definition at line 34 of file ezimagehandler.php.

Referenced by eZImageGDHandler\createFromINI(), eZImageShellHandler\createFromINI(), and rewriteURL().

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

- ezimagehandler.php

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