eZPublishCommunityProject(LegacyStack)  2013.6
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)
 
 createImageBorder ($imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
 cropImage ($imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
 eZImageGDHandler ($handlerName, $isGloballyEnabled, $outputRewriteType=self::REPLACE_SUFFIX, $conversionRules=false)
 
 scaleImage ($imageObject, $filterData, &$filterVariables, $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)
 
 setImageBorderWidth ($imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
 setImageColorspaceGray ($imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
 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 ()
 
 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 createFromINI ($iniGroup, $iniFilename=false)
 
static createGeometry ($width, $height, $x=0, $y=0)
 
static imageCopy ($imageObject, $destinationGeometry, $sourceGeometry, $sourceMimeData, $destinationMimeData)
 
static imageCreate ($width, $height, $isTrueColor=true)
 
static isImageTrueColor (&$imageObject, $mimeData)
 
static scaleImageCopy ($imageObject, $geometry, $sourceMimeData, $destinationMimeData)
 
static setImageBorderColor (&$imageObject, $filterData, &$filterVariables, $sourceMimeData, $destinationMimeData)
 
static setImageColorThreshold ($imageObject, $filterData, $sourceMimeData, $destinationMimeData, $thresholdList)
 
- Static Public Member Functions inherited from eZImageHandler
static changeFilePermissions ($filepath)
 
static convertFilterToText ($filterDefinition, $filterData)
 
static createFilterDefinitionFromINI ($filterText)
 
static wildcardToRegexp ($wildcard, $separatorCharacter=false)
 

Public Attributes

 $Executable
 
 $Path
 
 $PostParameters
 
 $PreParameters
 
- Public Attributes inherited from eZImageHandler
const KEEP_SUFFIX = 1
 
const PREPEND_TAG_REPLACE_SUFFIX = 3
 
const REPLACE_SUFFIX = 2
 

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.

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

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().

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

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 = self::REPLACE_SUFFIX,
  $conversionRules = false 
)

Constructor

Referenced by createFromINI().

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

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

Referenced by createImageBorder(), and cropImage().

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

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().

static 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
static eZImageGDHandler::scaleImageCopy (   $imageObject,
  $geometry,
  $sourceMimeData,
  $destinationMimeData 
)
static

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 
)
static eZImageGDHandler::setImageBorderColor ( $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)
static
eZImageGDHandler::setImageBorderWidth (   $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)
eZImageGDHandler::setImageColorspaceGray (   $imageObject,
  $filterData,
$filterVariables,
  $sourceMimeData,
  $destinationMimeData 
)

Converts the image to grayscale.

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

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
eZImageGDHandler::$Path
eZImageGDHandler::$PostParameters
eZImageGDHandler::$PreParameters

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