eZ Publish  [trunk]
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 ()
 rewriteURL ($originalMimeData, &$destinationMimeData, $rewriteType, $aliasName=false)
 supportedImageFilters ()
 supportedInputMIMETypes ()
 supportedOutputMIMETypes ()
 tagForMIMEType ($mimeData)
 textForFilter ($filterData)

Static Public Member Functions

static changeFilePermissions ($filepath)
static convertFilterToText ($filterDefinition, $filterData)
static createFilterDefinitionFromINI ($filterText)
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 18 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 243 of file ezimagehandler.php.

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

Returns:
The conversion rules for this handler.

Definition at line 105 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 447 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 133 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 114 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 35 of file ezimagehandler.php.

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

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

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

Definition at line 437 of file ezimagehandler.php.

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

Definition at line 312 of file ezimagehandler.php.

Referenced by outputMIMEType().

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

Definition at line 285 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 346 of file ezimagehandler.php.

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

Definition at line 429 of file ezimagehandler.php.

Referenced by outputMIMEType().

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

Referenced by outputMIMEType().

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

Definition at line 97 of file ezimagehandler.php.

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

Referenced by isInputMIMETypeSupported().

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

Referenced by isOutputMIMETypeSupported().

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 82 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 153 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 263 of file ezimagehandler.php.

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


Member Data Documentation

Definition at line 20 of file ezimagehandler.php.

Definition at line 22 of file ezimagehandler.php.


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