eZPublish  3.9
eZImageGDHandler Class Reference

The class eZImageGDHandler does. More...

+ Inheritance diagram for eZImageGDHandler:
+ Collaboration diagram for eZImageGDHandler:

Public Member Functions

 calculateFixedHeightAspectGeometry ($sourceWidth, $sourceHeight, $destinationHeight, $allowUpScale)
 
 calculateFixedWidthAspectGeometry ($sourceWidth, $sourceHeight, $destinationWidth, $allowUpScale)
 
 calculateScaledAspectGeometry ($sourceWidth, $sourceHeight, $destinationWidth, $destinationHeight, $allowUpScale)
 
 calculateScaledPercentAspectGeometry ($sourceWidth, $sourceHeight, $destinationWidthPercent, $destinationHeightPercent, $allowUpScale)
 
 convert (&$manager, $sourceMimeData, &$destinationMimeData, $filters=false)
 
createFromINI ($iniGroup, $iniFilename=false)
 
 createGeometry ($width, $height, $x=0, $y=0)
 
createImageBorder (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
cropImage (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
 eZImageGDHandler ($handlerName, $isGloballyEnabled, $outputRewriteType=EZ_IMAGE_HANDLER_REPLACE_SUFFIX, $conversionRules=false)
 
imageCopy (&$imageObject, $destinationGeometry, $sourceGeometry, $sourceMimeData, $destinationMimeData)
 
 imageCreate ($width, $height, $isTrueColor=true)
 
scaleImage (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
scaleImageCopy (&$imageObject, $geometry, $sourceMimeData, $destinationMimeData)
 
scaleImageDownOnly (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
scaleImageExact (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
scaleImageHeight (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
scaleImageHeightDownOnly (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
scaleImagePercent (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
scaleImageWidth (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
scaleImageWidthDownOnly (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
setImageBorder (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
 setImageBorderColor (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
 setImageBorderWidth (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
setImageColorspaceGray (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
setImageColorThreshold (&$imageObject, $filterData, $sourceMimeData, $destinationMimeData, $thresholdList)
 
setImageColorThresholdName (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
setImageLuminance (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
setImageLuminanceColorScale (&$imageObject, $filterData, $sourceMimeData, $destinationMimeData, $colorScale)
 
setImageLuminanceNamed (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
- Public Member Functions inherited from eZImageHandler
 conversionRules ()
 
 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

 isImageTrueColor (&$imageObject, $mimeData)
 
- Static Public Member Functions inherited from eZImageHandler
 changeFilePermissions ($filepath)
 
 wildcardToRegexp ($wildcard, $separatorCharacter=false)
 

Private Attributes

 $Executable
 
 $Path
 
 $PostParameters
 
 $PreParameters
 

Detailed Description

The class eZImageGDHandler does.

A geometry array has the following entries.

  • x - The x position
  • y - The y position
  • width - The width
  • height - The height

Member Function Documentation

eZImageGDHandler::calculateFixedHeightAspectGeometry (   $sourceWidth,
  $sourceHeight,
  $destinationHeight,
  $allowUpScale 
)

Calculates the geometry for the scaled image with a fixed height while maintaining the aspect ratio.

Parameters
$allowUpScaleIf this is true images will be scaled up as well, if not they will keep their source size.
Returns
a geometry array.
See Also
createGeometry

Referenced by scaleImageHeight(), and scaleImageHeightDownOnly().

eZImageGDHandler::calculateFixedWidthAspectGeometry (   $sourceWidth,
  $sourceHeight,
  $destinationWidth,
  $allowUpScale 
)

Calculates the geometry for the scaled image with a fixed width while maintaining the aspect ratio.

Parameters
$allowUpScaleIf this is true images will be scaled up as well, if not they will keep their source size.
Returns
a geometry array.
See Also
createGeometry

Referenced by scaleImageWidth(), and scaleImageWidthDownOnly().

eZImageGDHandler::calculateScaledAspectGeometry (   $sourceWidth,
  $sourceHeight,
  $destinationWidth,
  $destinationHeight,
  $allowUpScale 
)

Calculates the geometry for the scaled image while maintaining the aspect ratio.

Parameters
$allowUpScaleIf this is true images will be scaled up as well, if not they will keep their source size.
Returns
a geometry array.
See Also
createGeometry

Referenced by calculateScaledPercentAspectGeometry(), scaleImage(), and scaleImageDownOnly().

eZImageGDHandler::calculateScaledPercentAspectGeometry (   $sourceWidth,
  $sourceHeight,
  $destinationWidthPercent,
  $destinationHeightPercent,
  $allowUpScale 
)

Calculates the geometry for the scaled image in terms of percent while maintaining the aspect ratio.

Parameters
$allowUpScaleIf this is true images will be scaled up as well, if not they will keep their source size.
Note
Percentage must be given as a float value, e.g. 50% is 0.5 and 200% is 2.0
Returns
a geometry array.
See Also
createGeometry

Referenced by scaleImagePercent().

eZImageGDHandler::convert ( $manager,
  $sourceMimeData,
$destinationMimeData,
  $filters = false 
)
virtual

Creates the shell string and runs the executable.

Implements eZImageHandler.

& eZImageGDHandler::createFromINI (   $iniGroup,
  $iniFilename = false 
)

Creates a new image handler for shell executable from INI settings. The INI settings are read from ini file $iniFilename and group $iniGroup. If $iniFilename is not supplied image.ini is used.

Referenced by eZImageGDFactory\produceFromINI().

eZImageGDHandler::createGeometry (   $width,
  $height,
  $x = 0,
  $y = 0 
)

Creates a geometry array with width $width, height $height, x position $x and y position $y and returns it.

Referenced by calculateFixedHeightAspectGeometry(), calculateFixedWidthAspectGeometry(), calculateScaledAspectGeometry(), createImageBorder(), cropImage(), and scaleImageExact().

& eZImageGDHandler::createImageBorder ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)
& eZImageGDHandler::cropImage ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Crops a portion of the image from the filter parameters.

eZImageGDHandler::eZImageGDHandler (   $handlerName,
  $isGloballyEnabled,
  $outputRewriteType = EZ_IMAGE_HANDLER_REPLACE_SUFFIX,
  $conversionRules = false 
)

Constructor

Referenced by createFromINI().

& eZImageGDHandler::imageCopy ( $imageObject,
  $destinationGeometry,
  $sourceGeometry,
  $sourceMimeData,
  $destinationMimeData 
)

Copies a portion of the source image $imageObject to a new image.

Referenced by createImageBorder(), and cropImage().

eZImageGDHandler::imageCreate (   $width,
  $height,
  $isTrueColor = true 
)

Creates a new GD image and returns it.

Parameters
$isTrueColordetermines if a true color image is created, if false an indexed image is created.

Referenced by imageCopy(), and scaleImageCopy().

eZImageGDHandler::isImageTrueColor ( $imageObject,
  $mimeData 
)
static
Returns
true if the image object $imageObject is in true color format.

Referenced by imageCopy(), and scaleImageCopy().

& eZImageGDHandler::scaleImage ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData with aspect ration maintained. This means that image will not be exactly the image size.

See Also
scaleImageExact
& eZImageGDHandler::scaleImageCopy ( $imageObject,
  $geometry,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData.

Referenced by scaleImage(), scaleImageDownOnly(), scaleImageExact(), scaleImageHeight(), scaleImageHeightDownOnly(), scaleImagePercent(), scaleImageWidth(), and scaleImageWidthDownOnly().

& eZImageGDHandler::scaleImageDownOnly ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData with aspect ration maintained. This means that image will not be exactly the image size.

Note
The image will not be scaled if the source size is smaller than the destination size.
See Also
scaleImageExact
& eZImageGDHandler::scaleImageExact ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData without caring about aspect ratio.

& eZImageGDHandler::scaleImageHeight ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData with aspect ration maintained. This means that image will not be exactly the image size.

See Also
scaleImageExact
& eZImageGDHandler::scaleImageHeightDownOnly ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData with aspect ration maintained. This means that image will not be exactly the image size.

Note
The image will not be scaled if the source size is smaller than the destination size.
See Also
scaleImageExact
& eZImageGDHandler::scaleImagePercent ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData with aspect ratio maintained.

& eZImageGDHandler::scaleImageWidth ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData with aspect ration maintained. This means that image will not be exactly the image size.

See Also
scaleImageExact
& eZImageGDHandler::scaleImageWidthDownOnly ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Scales the image $imageObject to the size specified in $filterData with aspect ration maintained. This means that image will not be exactly the image size.

Note
The image will not be scaled if the source size is smaller than the destination size.
See Also
scaleImageExact
& eZImageGDHandler::setImageBorder ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)
eZImageGDHandler::setImageBorderColor ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)
eZImageGDHandler::setImageBorderWidth ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)
& eZImageGDHandler::setImageColorspaceGray ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Converts the image to grayscale.

& eZImageGDHandler::setImageColorThreshold ( $imageObject,
  $filterData,
  $sourceMimeData,
  $destinationMimeData,
  $thresholdList 
)

Changes the colors of the image based on threshold values. The luminance will be calculated and if it is in a threshold range it will use the specified color for the range.

Referenced by setImageColorThresholdName().

& eZImageGDHandler::setImageColorThresholdName ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Changes the colors of the image based on threshold values. The threshold values are based on the filter name.

& eZImageGDHandler::setImageLuminance ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Changes the colors of the image based on the luminance. The new scale for the colors are taken from the filter parameters, the parameters must contain three values.

& eZImageGDHandler::setImageLuminanceColorScale ( $imageObject,
  $filterData,
  $sourceMimeData,
  $destinationMimeData,
  $colorScale 
)

Changes the colors of the image based on the luminance.

Parameters
$colorScaleis an array with three float elements in range 0 to 1 that define the new color scale.

Referenced by setImageColorspaceGray(), setImageLuminance(), and setImageLuminanceNamed().

& eZImageGDHandler::setImageLuminanceNamed ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Changes the colors of the image based on the luminance. The new scale for the colors are based on the name of the filters.

Member Data Documentation

eZImageGDHandler::$Executable
private
eZImageGDHandler::$Path
private
eZImageGDHandler::$PostParameters
private
eZImageGDHandler::$PreParameters
private

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