eZPublish  3.9
eZImageHandler Class Referenceabstract

The class eZImageHandler does. More...

+ Inheritance diagram for eZImageHandler:

Public Member Functions

 conversionRules ()
 
 convert (&$manager, $sourceMimeData, &$destinationMimeData, $filters=false)
 
 convertFilterToText ($filterDefinition, $filterData)
 
 createFilterDefinitionFromINI ($filterText)
 
 eZImageHandler ($handlerName, $isEnabled=true, $outputRewriteType=EZ_IMAGE_HANDLER_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

 changeFilePermissions ($filepath)
 
 wildcardToRegexp ($wildcard, $separatorCharacter=false)
 

Detailed Description

The class eZImageHandler does.

Member Function Documentation

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

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

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

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.

eZImageHandler::convertFilterToText (   $filterDefinition,
  $filterData 
)

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

Referenced by textForFilter().

eZImageHandler::createFilterDefinitionFromINI (   $filterText)

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

Referenced by eZImageShellHandler\createFromINI().

eZImageHandler::eZImageHandler (   $handlerName,
  $isEnabled = true,
  $outputRewriteType = EZ_IMAGE_HANDLER_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.

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.
eZImageHandler::isFilterSupported (   $filter)
Returns
true if the filter $filter is supported by this handler.
eZImageHandler::isInputMIMETypeSupported (   $mimeData)
Returns
true if the MIME-Type defined in $mimeData is supported as input by this handler.

Referenced by outputMIMEType().

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

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.
eZImageHandler::outputRewriteType ( )
Returns
the type of filename rewrite this handler uses for output.

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:

  • EZ_IMAGE_HANDLER_KEEP_SUFFIX - Does nothing to the url
  • EZ_IMAGE_HANDLER_REPLACE_SUFFIX - Replaces the suffix or the url
  • EZ_IMAGE_HANDLER_PREPEND_TAG_REPLACE_SUFFIX - Prepends the tag name and replaces the suffix of the url The new url is placed in the $destinationMimeData.

Referenced by outputMIMEType().

eZImageHandler::supportedImageFilters ( )
Returns
an array with the names of the filters this handler can work with.
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

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

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.

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

eZImageHandler::textForFilter (   $filterData)

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

Referenced by eZImageShellHandler\convert().

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

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

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


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