eZ Publish  [4.2]
eZImageHandler Class Reference

The class eZImageHandler does. More...

+ Inheritance diagram for eZImageHandler:

List of all members.

Public Member Functions

 conversionRules ()
 convert ($manager, $sourceMimeData, &$destinationMimeData, $filters=false)
 eZImageHandler ($handlerName, $isEnabled=true, $outputRewriteType=self::REPLACE_SUFFIX, $supportedInputMIMETypes=false, $supportedOutputMIMETypes, $conversionRules=false, $filters=false, $mimeTagMap=false)
 isAvailable ()
 isFilterSupported ($filter)
 isInputMIMETypeSupported ($mimeData)
 isOutputMIMETypeSupported ($mimeData)
 outputMIMEType (&$manager, $currentMimeData, $wantedMimeData, $supportedFormatsOriginal, $aliasName=false)
 outputRewriteType ()
 supportedImageFilters ()
 supportedInputMIMETypes ()
 supportedOutputMIMETypes ()
 tagForMIMEType ($mimeData)
 textForFilter ($filterData)

Static Public Member Functions

static changeFilePermissions ($filepath)
static convertFilterToText ($filterDefinition, $filterData)
static createFilterDefinitionFromINI ($filterText)
static rewriteURL ($originalMimeData, &$destinationMimeData, $rewriteType, $aliasName=false)
static wildcardToRegexp ($wildcard, $separatorCharacter=false)

Public Attributes

const KEEP_SUFFIX = 1
const PREPEND_TAG_REPLACE_SUFFIX = 3
const REPLACE_SUFFIX = 2

Detailed Description

The class eZImageHandler does.

Definition at line 41 of file ezimagehandler.php.


Member Function Documentation

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 266 of file ezimagehandler.php.

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

eZImageHandler::conversionRules ( )
Returns:
The conversion rules for this handler.

Definition at line 128 of file ezimagehandler.php.

Referenced by outputMIMEType().

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 eZImageGDHandler, and eZImageShellHandler.

Definition at line 471 of file ezimagehandler.php.

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 156 of file ezimagehandler.php.

Referenced by textForFilter().

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 137 of file ezimagehandler.php.

Referenced by eZImageShellHandler\createFromINI().

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

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

Parameters:
$handlerNameThe name of the current handler
$isEnabledA boolean which tells whether the handler can be used or not
$outputRewriteTypeDefines how output filenames are rewritten
$supportedInputMIMETypesA list of MIME-Types the handler supports as input or false if no type as defined
$supportedOutputMIMETypesA list of MIME-Types the handler supports as output or false if no type as defined
$conversionRulesA list of conversion rules specific for this handler, is combined with the global rules
$filtersA list of filters this handler supports
$mimeTagMapA mapping table which maps from a MIME-Type to a specific tag, this tag can be used when rewriting the filename.

Definition at line 58 of file ezimagehandler.php.

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

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 94 of file ezimagehandler.php.

eZImageHandler::isFilterSupported ( filter)
Returns:
true if the filter $filter is supported by this handler.

Definition at line 461 of file ezimagehandler.php.

eZImageHandler::isInputMIMETypeSupported ( mimeData)
Returns:
true if the MIME-Type defined in $mimeData is supported as input by this handler.

Definition at line 336 of file ezimagehandler.php.

Referenced by outputMIMEType().

eZImageHandler::isOutputMIMETypeSupported ( mimeData)
Returns:
true if the MIME-Type defined in $mimeData is supported as output by this handler.

Definition at line 309 of file ezimagehandler.php.

Referenced by 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:
$wantedMimeDataan optional MIME structure for the wanted output type, if a direct conversion rule exists from $currentMimeData to $wantedMimeData then this is used.
$aliasNameAn 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 370 of file ezimagehandler.php.

eZImageHandler::outputRewriteType ( )
Returns:
the type of filename rewrite this handler uses for output.

Definition at line 453 of file ezimagehandler.php.

Referenced by outputMIMEType().

static eZImageHandler::rewriteURL ( originalMimeData,
&$  destinationMimeData,
rewriteType,
aliasName = false 
) [static]

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 195 of file ezimagehandler.php.

Referenced by outputMIMEType().

eZImageHandler::supportedImageFilters ( )
Returns:
an array with the names of the filters this handler can work with.

Definition at line 120 of file ezimagehandler.php.

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 244 of file ezimagehandler.php.

Referenced by isInputMIMETypeSupported().

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 255 of file ezimagehandler.php.

Referenced by isOutputMIMETypeSupported().

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 105 of file ezimagehandler.php.

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

eZImageHandler::textForFilter ( filterData)

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

Definition at line 176 of file ezimagehandler.php.

Referenced by eZImageShellHandler\convert().

static eZImageHandler::wildcardToRegexp ( wildcard,
separatorCharacter = false 
) [static]

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

Definition at line 287 of file ezimagehandler.php.

Referenced by isInputMIMETypeSupported(), isOutputMIMETypeSupported(), and outputMIMEType().


Member Data Documentation

Definition at line 43 of file ezimagehandler.php.

Definition at line 45 of file ezimagehandler.php.


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