TYPO3  7.6
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
GraphicalFunctions Class Reference
Inheritance diagram for GraphicalFunctions:
GifBuilder

Public Member Functions

 init ()
 
 maskImageOntoImage (&$im, $conf, $workArea)
 
 copyImageOntoImage (&$im, $conf, $workArea)
 
 copyGifOntoGif (&$im, $cpImg, $conf, $workArea)
 
 imagecopyresized (&$dstImg, $srcImg, $dstX, $dstY, $srcX, $srcY, $dstWidth, $dstHeight, $srcWidth, $srcHeight)
 
 makeText (&$im, $conf, $workArea)
 
 txtPosition ($conf, $workArea, $BB)
 
 calcBBox ($conf)
 
 addToMap ($cords, $conf)
 
 calcTextCordsForMap ($cords, $offset, $conf)
 
 SpacedImageTTFText (&$im, $fontSize, $angle, $x, $y, $Fcolor, $fontFile, $text, $spacing, $wordSpacing, $splitRenderingConf, $sF=1)
 
 fontResize ($conf)
 
 ImageTTFBBoxWrapper ($fontSize, $angle, $fontFile, $string, $splitRendering, $sF=1)
 
 ImageTTFTextWrapper ($im, $fontSize, $angle, $x, $y, $color, $fontFile, $string, $splitRendering, $sF=1)
 
 splitString ($string, $splitRendering, $fontSize, $fontFile)
 
 calcWordSpacing ($conf, $scaleFactor=1)
 
 getTextScalFactor ($conf)
 
 makeOutline (&$im, $conf, $workArea, $txtConf)
 
 circleOffset ($distance, $iterations)
 
 makeEmboss (&$im, $conf, $workArea, $txtConf)
 
 makeShadow (&$im, $conf, $workArea, $txtConf)
 
 makeBox (&$im, $conf, $workArea)
 
 makeEllipse (&$im, array $conf, array $workArea)
 
 makeEffect (&$im, $conf)
 
 IMparams ($setup)
 
 adjust (&$im, $conf)
 
 crop (&$im, $conf)
 
 scale (&$im, $conf)
 
 setWorkArea ($workArea)
 
 autolevels (&$im)
 
 outputLevels (&$im, $low, $high, $swap= '')
 
 inputLevels (&$im, $low, $high)
 
 IMreduceColors ($file, $cols)
 
 prependAbsolutePath ($fontFile)
 
 v5_sharpen ($factor)
 
 v5_blur ($factor)
 
 randomName ()
 
 applyOffset ($cords, $OFFSET)
 
 convertColor ($string)
 
 recodeString ($string)
 
 singleChars ($theText, $returnUnicodeNumber=false)
 
 objPosition ($conf, $workArea, $BB)
 
 imageMagickConvert ($imagefile, $newExt= '', $w= '', $h= '', $params= '', $frame= '', $options=array(), $mustCreate=false)
 
 getImageDimensions ($imageFile)
 
 getImageScale ($info, $w, $h, $options)
 
 imageMagickIdentify ($imagefile)
 
 imageMagickExec ($input, $output, $params, $frame=0)
 
 combineExec ($input, $overlay, $mask, $output, $handleNegation=false)
 
 checkFile ($file)
 
 createTempSubDir ($dirName)
 
 applyImageMagickToPHPGif (&$im, $command)
 
 gif_or_jpg ($type, $w, $h)
 
 output ($file)
 
 destroy ()
 
 imgTag ($imgInfo)
 
 ImageWrite ($destImg, $theImage, $quality=0)
 
 imageCreateFromFile ($sourceImg)
 
 hexColor ($col)
 
 unifyColors (&$img, $colArr, $closest=false)
 
 getTemporaryImageWithText ($filename, $textline1, $textline2, $textline3)
 

Static Public Member Functions

static gifCompress ($theFile, $type)
 
static pngToGifByImagemagick ($theFile)
 
static readPngGif ($theFile, $output_png=false)
 

Public Attributes

 $noFramePrepended = 0
 
 $gifExtension = 'gif'
 
 $gdlibExtensions = ''
 
 $png_truecolor = false
 
 $truecolorColors = 16777215
 
 $imageFileExt = 'gif,jpg,jpeg,png,tif,bmp,tga,pcx,ai,pdf'
 
 $webImageExt = 'gif,jpg,jpeg,png'
 
 $NO_IM_EFFECTS = ''
 
 $cmds
 
 $NO_IMAGE_MAGICK = ''
 
 $V5_EFFECTS = 0
 
 $mayScaleUp = 1
 
 $filenamePrefix = ''
 
 $imageMagickConvert_forceFileNameBody = ''
 
 $dontCheckForExistingTempFile = 0
 
 $dontCompress = 0
 
 $dontUnlinkTempFiles = 0
 
 $alternativeOutputKey = ''
 
 $IM_commands = array()
 
 $workArea = array()
 
 $tempPath = 'typo3temp/'
 
 $absPrefix = ''
 
 $scalecmd = '-geometry'
 
 $im5fx_blurSteps = '1x2,2x2,3x2,4x3,5x3,5x4,6x4,7x5,8x5,9x5'
 
 $im5fx_sharpenSteps = '1x2,2x2,3x2,2x3,3x3,4x3,3x4,4x4,4x5,5x5'
 
 $pixelLimitGif = 10000
 
 $colMap
 
 $csConvObj
 
 $nativeCharset = ''
 

Protected Member Functions

 renderTTFText (&$im, $fontSize, $angle, $x, $y, $color, $fontFile, $string, $splitRendering, $conf, $sF=1)
 
 getWordPairsForLineBreak ($string)
 
 getRenderedTextWidth ($text, $conf)
 
 getBreakSpace ($conf, array $boundingBox=null)
 
 generateCacheKeyForImageFile ($filePath)
 
 generateStatusHashForImageFile ($filePath)
 

Protected Attributes

 $colorspace = 'RGB'
 
 $allowedColorSpaceNames
 
 $saveAlphaLayer = false
 

Detailed Description

Standard graphical functions

Class contains a bunch of cool functions for manipulating graphics with GDlib/Freetype and ImageMagick. VERY OFTEN used with gifbuilder that extends this class and provides a TypoScript API to using these functions

Definition at line 27 of file GraphicalFunctions.php.

Member Function Documentation

addToMap (   $cords,
  $conf 
)

Adds an <area> tag to the internal variable $this->map which is used to accumulate the content for an ImageMap

Parameters
array$cordsCoordinates for a polygon image map as created by ->calcTextCordsForMap()
array$confConfiguration for "imgMap." property of a TEXT GIFBUILDER object.
Returns
void private
See Also
makeText(), calcTextCordsForMap()

Definition at line 844 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\makeText().

adjust ( $im,
  $conf 
)

Implements the "ADJUST" GIFBUILDER object

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
Returns
void
See Also
::make(), autoLevels(), outputLevels(), inputLevels()

Definition at line 1717 of file GraphicalFunctions.php.

References GraphicalFunctions\inputLevels(), GeneralUtility\intExplode(), and GraphicalFunctions\outputLevels().

Referenced by GifBuilder\make().

applyImageMagickToPHPGif ( $im,
  $command 
)

Applies an ImageMagick parameter to a GDlib image pointer resource by writing the resource to file, performing an IM operation upon it and reading back the result into the ImagePointer.

Parameters
resource$imThe image pointer (reference)
string$commandThe ImageMagick parameters. Like effects, scaling etc.
Returns
void

Definition at line 2783 of file GraphicalFunctions.php.

References GraphicalFunctions\$gifExtension, GraphicalFunctions\imageCreateFromFile(), GraphicalFunctions\imageMagickExec(), GraphicalFunctions\ImageWrite(), and GraphicalFunctions\randomName().

Referenced by GraphicalFunctions\makeEffect().

applyOffset (   $cords,
  $OFFSET 
)

Applies offset value to coordinated in $cords. Basically the value of key 0/1 of $OFFSET is added to keys 0/1 of $cords

Parameters
array$cordsInteger coordinates in key 0/1
array$OFFSETOffset values in key 0/1
Returns
array Modified $cords array

Definition at line 2034 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\makeOutline(), GraphicalFunctions\makeShadow(), GraphicalFunctions\objPosition(), GraphicalFunctions\setWorkArea(), and GraphicalFunctions\txtPosition().

autolevels ( $im)

Apply auto-levels to input image pointer

Parameters
int$imGDlib Image Pointer
Returns
void

Definition at line 1849 of file GraphicalFunctions.php.

calcBBox (   $conf)

Calculates bounding box information for the TEXT GIFBUILDER object.

Parameters
array$confTypoScript array for the TEXT GIFBUILDER object
Returns
array Array with three keys [0]/[1] being x/y and [2] being the bounding box array private
See Also
txtPosition(), ::start()

Definition at line 764 of file GraphicalFunctions.php.

References GraphicalFunctions\calcWordSpacing(), elseif, GraphicalFunctions\getBreakSpace(), GraphicalFunctions\getRenderedTextWidth(), GraphicalFunctions\getTextScalFactor(), GraphicalFunctions\getWordPairsForLineBreak(), GraphicalFunctions\ImageTTFBBoxWrapper(), GraphicalFunctions\recodeString(), and GraphicalFunctions\singleChars().

Referenced by GraphicalFunctions\getBreakSpace(), and GraphicalFunctions\txtPosition().

calcTextCordsForMap (   $cords,
  $offset,
  $conf 
)

Calculating the coordinates for a TEXT string on an image map. Used in an <area> tag

Parameters
array$cordsCoordinates (from BBOX array)
array$offsetOffset array
array$confConfiguration for "imgMap." property of a TEXT GIFBUILDER object.
Returns
array private
See Also
makeText(), calcTextCordsForMap()

Definition at line 863 of file GraphicalFunctions.php.

References GeneralUtility\intExplode().

Referenced by GraphicalFunctions\makeText().

calcWordSpacing (   $conf,
  $scaleFactor = 1 
)

Calculates the spacing and wordSpacing values

Parameters
array$confTypoScript array for the TEXT GIFBUILDER object
int$scaleFactorTypoScript value from eg $conf['niceText.']['scaleFactor']
Returns
array Array with two keys [0]/[1] being array($spacing,$wordSpacing) private
See Also
calcBBox()

Definition at line 1207 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\calcBBox(), GraphicalFunctions\fontResize(), and GraphicalFunctions\makeText().

checkFile (   $file)

Returns TRUE if the input file existed

Parameters
string$fileInput file to check
Returns
string Returns the filename if the file existed, otherwise empty.

Definition at line 2747 of file GraphicalFunctions.php.

circleOffset (   $distance,
  $iterations 
)

Creates some offset values in an array used to simulate a circularly applied outline around TEXT

access private

Parameters
int$distanceDistance
int$iterationsIterations.
Returns
array
See Also
makeOutline()

Definition at line 1387 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\makeOutline().

combineExec (   $input,
  $overlay,
  $mask,
  $output,
  $handleNegation = false 
)

Executes an ImageMagick "combine" (or composite in newer times) on four filenames - $input, $overlay and $mask as input files and $output as the output filename (written to) Can be used for many things, mostly scaling and effects.

Parameters
string$inputThe relative (to PATH_site) image filepath, bottom file
string$overlayThe relative (to PATH_site) image filepath, overlay file (top)
string$maskThe relative (to PATH_site) image filepath, the mask file (grayscale)
string$outputThe relative (to PATH_site) image filepath, output filename (written to)
bool$handleNegation
Returns
void

Definition at line 2616 of file GraphicalFunctions.php.

References GraphicalFunctions\$gifExtension, CommandUtility\escapeShellArgument(), GeneralUtility\fixPermissions(), GeneralUtility\imageMagickCommand(), GraphicalFunctions\imageMagickExec(), and GraphicalFunctions\randomName().

Referenced by GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), and GraphicalFunctions\maskImageOntoImage().

convertColor (   $string)

Converts a "HTML-color" TypoScript datatype to RGB-values. Default is 0,0,0

Parameters
string$string"HTML-color" data type string, eg. 'red', '#ffeedd' or '255,0,255'. You can also add a modifying operator afterwards. There are two options: "255,0,255 : 20" - will add 20 to values, result is "255,20,255". Or "255,0,255 : *1.23" which will multiply all RGB values with 1.23
Returns
array RGB values in key 0/1/2 of the array

Definition at line 2048 of file GraphicalFunctions.php.

References elseif, and MathUtility\forceIntegerInRange().

Referenced by GraphicalFunctions\crop(), GraphicalFunctions\ImageTTFTextWrapper(), GifBuilder\make(), GraphicalFunctions\makeBox(), GraphicalFunctions\makeEllipse(), GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), and GraphicalFunctions\unifyColors().

copyGifOntoGif ( $im,
  $cpImg,
  $conf,
  $workArea 
)

Copies two GDlib image pointers onto each other, using TypoScript configuration from $conf and the input $workArea definition.

Parameters
resource$imGDlib image pointer, destination (bottom image)
resource$cpImgGDlib image pointer, source (top image)
array$confTypoScript array with the properties for the IMAGE GIFBUILDER object. Only used for the "tile" property value.
array$workAreaWork area
Returns
void Works on the $im image pointer private

Definition at line 497 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, MathUtility\forceIntegerInRange(), GraphicalFunctions\imagecopyresized(), GeneralUtility\intExplode(), and GraphicalFunctions\objPosition().

Referenced by GraphicalFunctions\copyImageOntoImage(), GraphicalFunctions\crop(), and GraphicalFunctions\maskImageOntoImage().

copyImageOntoImage ( $im,
  $conf,
  $workArea 
)

Implements the "IMAGE" GIFBUILDER object, when the "mask" property is FALSE (using only $conf['file'])

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
array$workAreaThe current working area coordinates.
Returns
void
See Also
::make(), maskImageOntoImage()

Definition at line 474 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GraphicalFunctions\copyGifOntoGif(), GraphicalFunctions\imageCreateFromFile(), GraphicalFunctions\imageMagickConvert(), and GeneralUtility\inList().

Referenced by GifBuilder\make().

createTempSubDir (   $dirName)

Creates subdirectory in typo3temp/ if not already found.

Parameters
string$dirNameName of sub directory
Returns
bool Result of ::mkdir(), TRUE if it went well.

Definition at line 2762 of file GraphicalFunctions.php.

References GraphicalFunctions\$tempPath, GeneralUtility\isFirstPartOfStr(), and GeneralUtility\mkdir().

Referenced by GifBuilder\gifBuild(), GraphicalFunctions\imageMagickConvert(), and GraphicalFunctions\randomName().

crop ( $im,
  $conf 
)

Implements the "CROP" GIFBUILDER object

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
Returns
void
See Also
::make()

Definition at line 1753 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GraphicalFunctions\convertColor(), GraphicalFunctions\copyGifOntoGif(), GeneralUtility\intExplode(), GraphicalFunctions\objPosition(), and GraphicalFunctions\setWorkArea().

Referenced by GifBuilder\make().

destroy ( )

Destroy internal image pointer, $this->im

Returns
void
See Also
::gifBuild()

Definition at line 2874 of file GraphicalFunctions.php.

Referenced by GifBuilder\gifBuild().

fontResize (   $conf)

Function that finds the right fontsize that will render the textstring within a certain width

Parameters
array$confThe TypoScript properties of the TEXT GIFBUILDER object
Returns
int The new fontSize private
See Also
::start()

Definition at line 930 of file GraphicalFunctions.php.

References GraphicalFunctions\calcWordSpacing(), elseif, GraphicalFunctions\ImageTTFBBoxWrapper(), and GraphicalFunctions\recodeString().

generateCacheKeyForImageFile (   $filePath)
protected

Creates the key for the image dimensions cache for an image file.

This method does not check if the image file actually exists.

Parameters
string$filePathImage file path, relative to PATH_site
Returns
string the hash key (an SHA1 hash), will not be empty

Definition at line 2394 of file GraphicalFunctions.php.

generateStatusHashForImageFile (   $filePath)
protected

Creates the status hash to check whether a file has been changed.

Parameters
string$filePathImage file path, relative to PATH_site
Returns
string the status hash (an SHA1 hash)

Definition at line 2406 of file GraphicalFunctions.php.

getBreakSpace (   $conf,
array  $boundingBox = null 
)
protected

Gets the break space for each new line.

Parameters
array$confTypoScript configuration for the currently rendered object
array$boundingBoxThe bounding box the the currently rendered object
Returns
int The break space

Definition at line 1328 of file GraphicalFunctions.php.

References GraphicalFunctions\calcBBox().

Referenced by GraphicalFunctions\calcBBox(), and GraphicalFunctions\renderTTFText().

getImageDimensions (   $imageFile)

Gets the input image dimensions.

Parameters
string$imageFileThe image filepath
Returns
array|NULL Returns an array where [0]/[1] is w/h, [2] is extension and [3] is the filename.
See Also
imageMagickConvert(), ::getImgResource()

Definition at line 2303 of file GraphicalFunctions.php.

References GraphicalFunctions\imageMagickIdentify(), and GeneralUtility\inList().

Referenced by GraphicalFunctions\imageMagickConvert(), and GraphicalFunctions\maskImageOntoImage().

getImageScale (   $info,
  $w,
  $h,
  $options 
)

Get numbers for scaling the image based on input

Parameters
array$infoCurrent image information: Width, Height etc.
int$w"required" width
int$h"required" height
array$optionsOptions: Keys are like "maxW", "maxH", "minW", "minH
Returns
array private
See Also
imageMagickConvert()

Definition at line 2424 of file GraphicalFunctions.php.

Referenced by LocalCropScaleMaskHelper\getNewSvgDimensions(), and GraphicalFunctions\imageMagickConvert().

getRenderedTextWidth (   $text,
  $conf 
)
protected

Gets the rendered text width.

Parameters
string$text
array$conf
int

Definition at line 1308 of file GraphicalFunctions.php.

References elseif, GraphicalFunctions\ImageTTFBBoxWrapper(), and GraphicalFunctions\recodeString().

Referenced by GraphicalFunctions\calcBBox(), and GraphicalFunctions\renderTTFText().

getTemporaryImageWithText (   $filename,
  $textline1,
  $textline2,
  $textline3 
)

Creates error image based on gfx/notfound_thumb.png Requires GD lib enabled, otherwise it will exit with the three textstrings outputted as text. Outputs the image stream to browser and exits!

Parameters
string$filenameName of the file
string$textline1Text line 1
string$textline2Text line 2
string$textline3Text line 3
Returns
void
Exceptions
\RuntimeException

Definition at line 3064 of file GraphicalFunctions.php.

References $filename, and $GLOBALS.

getTextScalFactor (   $conf)

Calculates and returns the niceText.scaleFactor

Parameters
array$confTypoScript array for the TEXT GIFBUILDER object
Returns
int TypoScript value from eg $conf['niceText.']['scaleFactor'] private

Definition at line 1224 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange().

Referenced by GraphicalFunctions\calcBBox().

getWordPairsForLineBreak (   $string)
protected

Gets the word pairs used for automatic line breaks.

Parameters
string$string
Returns
array

Definition at line 1290 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\calcBBox(), and GraphicalFunctions\renderTTFText().

gif_or_jpg (   $type,
  $w,
  $h 
)

Returns an image extension for an output image based on the number of pixels of the output and the file extension of the original file. For example: If the number of pixels exceeds $this->pixelLimitGif (normally 10000) then it will be a "jpg" string in return.

Parameters
string$typeThe file extension, lowercase.
int$wThe width of the output image.
int$hThe height of the output image.
Returns
string The filename, either "jpg" or "gif"/"png" (whatever $this->gifExtension is set to.)

Definition at line 2810 of file GraphicalFunctions.php.

References GraphicalFunctions\$gifExtension.

Referenced by GraphicalFunctions\imageMagickConvert().

static gifCompress (   $theFile,
  $type 
)
static

Compressing a GIF file if not already LZW compressed. This function is a workaround for the fact that ImageMagick and/or GD does not compress GIF-files to their minimun size (that is RLE or no compression used)

The function takes a file-reference, $theFile, and saves it again through GD or ImageMagick in order to compress the file GIF: If $type is not set, the compression is done with ImageMagick (provided that $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] is pointing to the path of a lzw-enabled version of 'convert') else with GD (should be RLE-enabled!) If $type is set to either 'IM' or 'GD' the compression is done with ImageMagick and GD respectively PNG: No changes.

$theFile is expected to be a valid GIF-file! The function returns a code for the operation.

Parameters
string$theFileFilepath
string$typeSee description of function
Returns
string Returns "GD" if GD was used, otherwise "IM" if ImageMagick was used. If nothing done at all, it returns empty string.

Definition at line 2653 of file GraphicalFunctions.php.

References $GLOBALS, elseif, CommandUtility\exec(), GeneralUtility\fixPermissions(), and GeneralUtility\imageMagickCommand().

Referenced by GeneralUtility\gif_compress(), and IconUtility\makeIcon().

hexColor (   $col)

Returns the HEX color value for an RGB color array

Parameters
arrayRGB color array
Returns
string HEX color value

Definition at line 2981 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\unifyColors().

imagecopyresized ( $dstImg,
  $srcImg,
  $dstX,
  $dstY,
  $srcX,
  $srcY,
  $dstWidth,
  $dstHeight,
  $srcWidth,
  $srcHeight 
)

Alternative function for using the similar PHP function imagecopyresized(). Used for GD2 only.

OK, the reason for this stupid fix is the following story: GD1.x was capable of copying two images together and combining their palettes! GD2 is apparently not. With GD2 only the palette of the dest-image is used which mostly results in totally black images when trying to copy a color-ful image onto the destination. The GD2-fix is to 1) Create a blank TRUE-COLOR image 2) Copy the destination image onto that one 3) Then do the actual operation; Copying the source (top image) onto that 4) ... and return the result pointer. 5) Reduce colors (if we do not, the result may become strange!) It works, but the resulting images is now a true-color PNG which may be very large. So, why not use 'imagetruecolortopalette ($im, TRUE, 256)' - well because it does NOT WORK! So simple is that.

Parameters
resource$dstImgDestination image
resource$srcImgSource image
int$dstXDestination x-coordinate
int$dstYDestination y-coordinate
int$srcXSource x-coordinate
int$srcYSource y-coordinate
int$dstWidthDestination width
int$dstHeightDestination height
int$srcWidthSource width
int$srcHeightSource height
Returns
void private
See Also
::imagecopyresized()

Definition at line 578 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\copyGifOntoGif(), and GraphicalFunctions\makeShadow().

imageCreateFromFile (   $sourceImg)

Creates a new GDlib image resource based on the input image filename. If it fails creating an image from the input file a blank gray image with the dimensions of the input image will be created instead.

Parameters
string$sourceImgImage filename
Returns
resource Image Resource pointer

Definition at line 2940 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\applyImageMagickToPHPGif(), GraphicalFunctions\copyImageOntoImage(), GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), GraphicalFunctions\maskImageOntoImage(), GraphicalFunctions\scale(), and GraphicalFunctions\unifyColors().

imageMagickConvert (   $imagefile,
  $newExt = '',
  $w = '',
  $h = '',
  $params = '',
  $frame = '',
  $options = array(),
  $mustCreate = false 
)

Converts $imagefile to another file in temp-dir of type $newExt (extension).

Parameters
string$imagefileThe image filepath
string$newExtNew extension, eg. "gif", "png", "jpg", "tif". If $newExt is NOT set, the new imagefile will be of the original format. If newExt = 'WEB' then one of the web-formats is applied.
string$wWidth. $w / $h is optional. If only one is given the image is scaled proportionally. If an 'm' exists in the $w or $h and if both are present the $w and $h is regarded as the Maximum w/h and the proportions will be kept
string$hHeight. See $w
string$paramsAdditional ImageMagick parameters.
string$frameRefers to which frame-number to select in the image. '' or 0 will select the first frame, 1 will select the next and so on...
array$optionsAn array with options passed to getImageScale (see this function).
bool$mustCreateIf set, then another image than the input imagefile MUST be returned. Otherwise you can risk that the input image is good enough regarding messures etc and is of course not rendered to a new, temporary file in typo3temp/. But this option will force it to.
Returns
array [0]/[1] is w/h, [2] is file extension and [3] is the filename.
See Also
getImageScale(), typo3/show_item.php, fileList_ext::renderImage(), ::getImgResource(), SC_tslib_showpic::show(), maskImageOntoImage(), copyImageOntoImage(), scale()

Definition at line 2197 of file GraphicalFunctions.php.

References GraphicalFunctions\$imageMagickConvert_forceFileNameBody, GraphicalFunctions\createTempSubDir(), GraphicalFunctions\getImageDimensions(), GraphicalFunctions\getImageScale(), GraphicalFunctions\gif_or_jpg(), GraphicalFunctions\imageMagickExec(), GeneralUtility\inList(), and GeneralUtility\shortMD5().

Referenced by GraphicalFunctions\copyImageOntoImage(), GraphicalFunctions\maskImageOntoImage(), and GraphicalFunctions\scale().

imageMagickExec (   $input,
  $output,
  $params,
  $frame = 0 
)

Executes an ImageMagick "convert" on two filenames, $input and $output using $params before them. Can be used for many things, mostly scaling and effects.

Parameters
string$inputThe relative (to PATH_site) image filepath, input file (read from)
string$outputThe relative (to PATH_site) image filepath, output filename (written to)
string$paramsImageMagick parameters
int$frameOptional, refers to which frame-number to select in the image. '' or 0
Returns
string The result of a call to PHP function "exec()

Definition at line 2586 of file GraphicalFunctions.php.

References CommandUtility\escapeShellArgument(), GeneralUtility\fixPermissions(), and GeneralUtility\imageMagickCommand().

Referenced by GraphicalFunctions\applyImageMagickToPHPGif(), GraphicalFunctions\combineExec(), GraphicalFunctions\imageMagickConvert(), GraphicalFunctions\IMreduceColors(), GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), and GraphicalFunctions\unifyColors().

imageMagickIdentify (   $imagefile)

Returns an array where [0]/[1] is w/h, [2] is extension and [3] is the filename. Using ImageMagick

Parameters
string$imagefileThe relative (to PATH_site) image filepath
Returns
array

Definition at line 2547 of file GraphicalFunctions.php.

References CommandUtility\escapeShellArgument(), and GeneralUtility\imageMagickCommand().

Referenced by GraphicalFunctions\getImageDimensions().

ImageTTFBBoxWrapper (   $fontSize,
  $angle,
  $fontFile,
  $string,
  $splitRendering,
  $sF = 1 
)

Wrapper for ImageTTFBBox

Parameters
int$fontSize(See argument for PHP function ImageTTFBBox())
int$angle(See argument for PHP function ImageTTFBBox())
string$fontFile(See argument for PHP function ImageTTFBBox())
string$string(See argument for PHP function ImageTTFBBox())
array$splitRenderingSplit-rendering configuration
int$sFScale factor
Returns
array Information array.

Calculate Bounding Box for part. Due to a PHP bug, we must retry if $calc[2] is negative.

See Also
https://bugs.php.net/bug.php?id=51315
https://bugs.php.net/bug.php?id=22513

Definition at line 973 of file GraphicalFunctions.php.

References debug(), GeneralUtility\freetypeDpiComp(), and GraphicalFunctions\splitString().

Referenced by GraphicalFunctions\calcBBox(), GraphicalFunctions\fontResize(), GraphicalFunctions\getRenderedTextWidth(), and GraphicalFunctions\SpacedImageTTFText().

ImageTTFTextWrapper (   $im,
  $fontSize,
  $angle,
  $x,
  $y,
  $color,
  $fontFile,
  $string,
  $splitRendering,
  $sF = 1 
)

Wrapper for ImageTTFText

Parameters
resource$im(See argument for PHP function imageTTFtext())
int$fontSize(See argument for PHP function imageTTFtext())
int$angle(See argument for PHP function imageTTFtext())
int$x(See argument for PHP function imageTTFtext())
int$y(See argument for PHP function imageTTFtext())
int$color(See argument for PHP function imageTTFtext())
string$fontFile(See argument for PHP function imageTTFtext())
string$string(See argument for PHP function imageTTFtext()). UTF-8 string, possibly with entities in.
array$splitRenderingSplit-rendering configuration
int$sFScale factor
Returns
void

Definition at line 1025 of file GraphicalFunctions.php.

References GraphicalFunctions\convertColor(), debug(), GeneralUtility\freetypeDpiComp(), and GraphicalFunctions\splitString().

Referenced by GraphicalFunctions\renderTTFText(), and GraphicalFunctions\SpacedImageTTFText().

ImageWrite (   $destImg,
  $theImage,
  $quality = 0 
)

Writes the input GDlib image pointer to file

Parameters
resource$destImgThe GDlib image resource pointer
string$theImageThe filename to write to
int$qualityThe image quality (for JPEGs)
Returns
bool The output of either imageGif, imagePng or imageJpeg based on the filename to write
See Also
maskImageOntoImage(), scale(), output()

Definition at line 2899 of file GraphicalFunctions.php.

References GeneralUtility\fixPermissions().

Referenced by GraphicalFunctions\applyImageMagickToPHPGif(), GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), GraphicalFunctions\maskImageOntoImage(), GraphicalFunctions\output(), and GraphicalFunctions\scale().

imgTag (   $imgInfo)

Returns Image Tag for input image information array.

Parameters
array$imgInfoImage information array, key 0/1 is width/height and key 3 is the src value
Returns
string Image tag for the input image information array.

Definition at line 2885 of file GraphicalFunctions.php.

IMparams (   $setup)

Creating ImageMagick parameters from TypoScript property

Parameters
string$setupA string with effect keywords=value pairs separated by "|
Returns
string ImageMagick prepared parameters. private
See Also
makeEffect()

Definition at line 1631 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange(), GeneralUtility\intExplode(), GraphicalFunctions\v5_blur(), and GraphicalFunctions\v5_sharpen().

Referenced by GraphicalFunctions\makeEffect().

IMreduceColors (   $file,
  $cols 
)

Reduce colors in image using IM and create a palette based image if possible (<=256 colors)

Parameters
string$fileImage file to reduce
int$colsNumber of colors to reduce the image to.
Returns
string Reduced file

Definition at line 1935 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange(), GraphicalFunctions\imageMagickExec(), GraphicalFunctions\randomName(), and GeneralUtility\split_fileref().

Referenced by GraphicalFunctions\output().

init ( )

Init function. Must always call this when using the class. This function will read the configuration information from $GLOBALS['TYPO3_CONF_VARS']['GFX'] can set some values in internal variables.

Returns
void

Definition at line 299 of file GraphicalFunctions.php.

References $GLOBALS, elseif, MathUtility\forceIntegerInRange(), GeneralUtility\makeInstance(), and GraphicalFunctions\v5_sharpen().

inputLevels ( $im,
  $low,
  $high 
)

Apply input levels to input image pointer (increasing contrast)

Parameters
int$imGDlib Image Pointer
int$lowThe "low" value (close to 0)
int$highThe "high" value (close to 255)
Returns
void

Definition at line 1911 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange().

Referenced by GraphicalFunctions\adjust(), and GraphicalFunctions\makeShadow().

makeBox ( $im,
  $conf,
  $workArea 
)

Implements the "BOX" GIFBUILDER object

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
array$workAreaThe current working area coordinates.
Returns
void
See Also
::make()

Definition at line 1554 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GraphicalFunctions\convertColor(), MathUtility\forceIntegerInRange(), GeneralUtility\intExplode(), and GraphicalFunctions\objPosition().

Referenced by GifBuilder\make().

makeEffect ( $im,
  $conf 
)

Implements the "EFFECT" GIFBUILDER object The operation involves ImageMagick for applying effects

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
Returns
void
See Also
::make(), applyImageMagickToPHPGif()

Definition at line 1615 of file GraphicalFunctions.php.

References GraphicalFunctions\applyImageMagickToPHPGif(), and GraphicalFunctions\IMparams().

Referenced by GifBuilder\make().

makeEllipse ( $im,
array  $conf,
array  $workArea 
)

Implements the "Ellipse" GIFBUILDER object Example Typoscript: file = GIFBUILDER file { XY = 200,200 format = jpg quality = 100 10 = ELLIPSE 10.dimensions = 100,100,50,50 10.color = red

$workArea = X,Y $conf['dimensions'] = offset x, offset y, width of ellipse, height of ellipse

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
array$workAreaThe current working area coordinates.
Returns
void
See Also
::make()

Definition at line 1594 of file GraphicalFunctions.php.

References GraphicalFunctions\convertColor(), GeneralUtility\intExplode(), and GraphicalFunctions\objPosition().

Referenced by GifBuilder\make().

makeEmboss ( $im,
  $conf,
  $workArea,
  $txtConf 
)

Implements the "EMBOSS" GIFBUILDER object / property for the TEXT object

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
array$workAreaThe current working area coordinates.
array$txtConfTypoScript array with configuration for the associated TEXT GIFBUILDER object.
Returns
void
See Also
::make(), makeShadow()

Definition at line 1416 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GeneralUtility\intExplode(), and GraphicalFunctions\makeShadow().

Referenced by GifBuilder\make().

makeOutline ( $im,
  $conf,
  $workArea,
  $txtConf 
)

Implements the "OUTLINE" GIFBUILDER object / property for the TEXT object

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
array$workAreaThe current working area coordinates.
array$txtConfTypoScript array with configuration for the associated TEXT GIFBUILDER object.
Returns
void
See Also
::make(), makeText()

Definition at line 1357 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GraphicalFunctions\applyOffset(), GraphicalFunctions\circleOffset(), MathUtility\forceIntegerInRange(), and GraphicalFunctions\makeText().

Referenced by GifBuilder\make().

makeShadow ( $im,
  $conf,
  $workArea,
  $txtConf 
)

Implements the "SHADOW" GIFBUILDER object / property for the TEXT object The operation involves ImageMagick for combining.

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
array$workAreaThe current working area coordinates.
array$txtConfTypoScript array with configuration for the associated TEXT GIFBUILDER object.
Returns
void
See Also
::make(), makeText(), makeEmboss()

Definition at line 1439 of file GraphicalFunctions.php.

References GraphicalFunctions\$gifExtension, GraphicalFunctions\$workArea, GraphicalFunctions\applyOffset(), GraphicalFunctions\combineExec(), GraphicalFunctions\convertColor(), MathUtility\forceIntegerInRange(), GraphicalFunctions\imagecopyresized(), GraphicalFunctions\imageCreateFromFile(), GraphicalFunctions\imageMagickExec(), GraphicalFunctions\ImageWrite(), GraphicalFunctions\inputLevels(), GeneralUtility\intExplode(), GraphicalFunctions\makeText(), GraphicalFunctions\outputLevels(), GraphicalFunctions\randomName(), and GraphicalFunctions\v5_blur().

Referenced by GifBuilder\make(), and GraphicalFunctions\makeEmboss().

makeText ( $im,
  $conf,
  $workArea 
)
maskImageOntoImage ( $im,
  $conf,
  $workArea 
)

Implements the "IMAGE" GIFBUILDER object, when the "mask" property is TRUE. It reads the two images defined by $conf['file'] and $conf['mask'] and copies the $conf['file'] onto the input image pointer image using the $conf['mask'] as a grayscale mask The operation involves ImageMagick for combining.

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
array$workAreaThe current working area coordinates.
Returns
void
See Also
::make()

Definition at line 387 of file GraphicalFunctions.php.

References GraphicalFunctions\$gifExtension, GraphicalFunctions\$workArea, GraphicalFunctions\combineExec(), GraphicalFunctions\copyGifOntoGif(), GraphicalFunctions\getImageDimensions(), GraphicalFunctions\imageCreateFromFile(), GraphicalFunctions\imageMagickConvert(), GraphicalFunctions\ImageWrite(), GeneralUtility\inList(), and GraphicalFunctions\randomName().

Referenced by GifBuilder\make().

objPosition (   $conf,
  $workArea,
  $BB 
)

Create an array with object position/boundaries based on input TypoScript configuration (such as the "align" property is used), the work area definition and $BB array

Parameters
array$confTypoScript configuration for a GIFBUILDER object
arraymakeBox Workarea definition
array$BBBB (Bounding box) array. Not just used for TEXT objects but also for others
Returns
array [0]=x, [1]=y, [2]=w, [3]=h private
See Also
copyGifOntoGif(), makeBox(), crop()

Definition at line 2141 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GraphicalFunctions\applyOffset(), and GeneralUtility\intExplode().

Referenced by GraphicalFunctions\copyGifOntoGif(), GraphicalFunctions\crop(), GraphicalFunctions\makeBox(), and GraphicalFunctions\makeEllipse().

output (   $file)

Writing the internal image pointer, $this->im, to file based on the extension of the input filename Used in GIFBUILDER Uses $this->setup['reduceColors'] for gif/png images and $this->setup['quality'] for jpg images to reduce size/quality if needed.

Parameters
string$fileThe filename to write to.
Returns
string Returns input filename
See Also
::gifBuild()

Definition at line 2828 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange(), GraphicalFunctions\ImageWrite(), and GraphicalFunctions\IMreduceColors().

Referenced by GifBuilder\gifBuild().

outputLevels ( $im,
  $low,
  $high,
  $swap = '' 
)

Apply output levels to input image pointer (decreasing contrast)

Parameters
int$imGDlib Image Pointer
int$lowThe "low" value (close to 0)
int$highThe "high" value (close to 255)
bool$swapIf swap, then low and high are swapped. (Useful for negated masks...)
Returns
void

Definition at line 1881 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange().

Referenced by GraphicalFunctions\adjust(), and GraphicalFunctions\makeShadow().

static pngToGifByImagemagick (   $theFile)
static

Converts a png file to gif. This converts a png file to gif IF the FLAG $GLOBALS['TYPO3_CONF_VARS']['FE']['png_to_gif'] is set TRUE.

Parameters
string$theFileThe filename with path
Returns
string New filename or the old file name if no conversion happened
Deprecated:
since TYPO3 CMS 7, will be removed with TYPO3 CMS 8, as the png_to_gif option has been removed with TYPO3 CMS 7

Definition at line 2696 of file GraphicalFunctions.php.

References GeneralUtility\logDeprecatedFunction().

Referenced by GeneralUtility\png_to_gif_by_imagemagick().

prependAbsolutePath (   $fontFile)

Checks if the $fontFile is already at an absolute path and if not, prepends the correct path. Use PATH_site unless we are in the backend. Call it by ::prependAbsolutePath()

Parameters
string$fontFileThe font file
Returns
string The font file with absolute path.

Definition at line 1969 of file GraphicalFunctions.php.

References GeneralUtility\isAbsPath(), and GeneralUtility\resolveBackPath().

randomName ( )

Returns a random filename prefixed with "temp_" and then 32 char md5 hash (without extension) from $this->tempPath. Used by functions in this class to create truely temporary files for the on-the-fly processing. These files will most likely be deleted right away.

Returns
string

Definition at line 2020 of file GraphicalFunctions.php.

References GraphicalFunctions\createTempSubDir().

Referenced by GraphicalFunctions\applyImageMagickToPHPGif(), GraphicalFunctions\combineExec(), GraphicalFunctions\IMreduceColors(), GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), GraphicalFunctions\maskImageOntoImage(), GraphicalFunctions\scale(), and GraphicalFunctions\unifyColors().

static readPngGif (   $theFile,
  $output_png = false 
)
static

Returns filename of the png/gif version of the input file (which can be png or gif). If input file type does not match the wanted output type a conversion is made and temp-filename returned.

Parameters
string$theFileFilepath of image file
bool$output_pngIf TRUE, then input file is converted to PNG, otherwise to GIF
Returns
string|NULL If the new image file exists, its filepath is returned

Definition at line 2710 of file GraphicalFunctions.php.

References $GLOBALS, CommandUtility\exec(), GeneralUtility\fixPermissions(), GeneralUtility\imageMagickCommand(), and GeneralUtility\mkdir().

Referenced by IconUtility\imagecreatefrom(), and GeneralUtility\read_png_gif().

recodeString (   $string)

Recode string Used with text strings for fonts when languages has other character sets.

Parameters
stringThe text to recode
Returns
string The recoded string. Should be UTF-8 output. MAY contain entities (eg. &#123; or &#quot; which should render as real chars).

Definition at line 2098 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\calcBBox(), GraphicalFunctions\fontResize(), GraphicalFunctions\getRenderedTextWidth(), and GraphicalFunctions\makeText().

renderTTFText ( $im,
  $fontSize,
  $angle,
  $x,
  $y,
  $color,
  $fontFile,
  $string,
  $splitRendering,
  $conf,
  $sF = 1 
)
protected

Renders a regular text and takes care of a possible line break automatically.

Parameters
resource$im(See argument for PHP function imageTTFtext())
int$fontSize(See argument for PHP function imageTTFtext())
int$angle(See argument for PHP function imageTTFtext())
int$x(See argument for PHP function imageTTFtext())
int$y(See argument for PHP function imageTTFtext())
int$color(See argument for PHP function imageTTFtext())
string$fontFile(See argument for PHP function imageTTFtext())
string$string(See argument for PHP function imageTTFtext()). UTF-8 string, possibly with entities in.
array$splitRenderingSplit-rendering configuration
array$confThe configuration
int$sFScale factor
Returns
void

Definition at line 1251 of file GraphicalFunctions.php.

References GraphicalFunctions\getBreakSpace(), GraphicalFunctions\getRenderedTextWidth(), GraphicalFunctions\getWordPairsForLineBreak(), and GraphicalFunctions\ImageTTFTextWrapper().

Referenced by GraphicalFunctions\makeText().

scale ( $im,
  $conf 
)

Implements the "SCALE" GIFBUILDER object

Parameters
resource$imGDlib image pointer
array$confTypoScript array with configuration for the GIFBUILDER object.
Returns
void
See Also
::make()

Definition at line 1792 of file GraphicalFunctions.php.

References GraphicalFunctions\$gifExtension, GraphicalFunctions\imageCreateFromFile(), GraphicalFunctions\imageMagickConvert(), GraphicalFunctions\ImageWrite(), GraphicalFunctions\randomName(), and GraphicalFunctions\setWorkArea().

Referenced by GifBuilder\make().

setWorkArea (   $workArea)

Implements the "WORKAREA" GIFBUILDER object when setting it Setting internal working area boundaries (->workArea)

Parameters
string$workAreaWorking area dimensions, comma separated
Returns
void private
See Also
::make()

Definition at line 1826 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GraphicalFunctions\applyOffset(), and GeneralUtility\intExplode().

Referenced by GraphicalFunctions\crop(), GifBuilder\make(), and GraphicalFunctions\scale().

singleChars (   $theText,
  $returnUnicodeNumber = false 
)

Split a string into an array of individual characters The function will look at $this->nativeCharset and if that is set, the input string is expected to be UTF-8 encoded, possibly with entities in it. Otherwise the string is supposed to be a single-byte charset which is just splitted by a for-loop.

Parameters
string$theTextThe text string to split
bool$returnUnicodeNumberReturn Unicode numbers instead of chars.
Returns
array Numerical array with a char as each value.

Definition at line 2116 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\calcBBox(), GraphicalFunctions\SpacedImageTTFText(), and GraphicalFunctions\splitString().

SpacedImageTTFText ( $im,
  $fontSize,
  $angle,
  $x,
  $y,
  $Fcolor,
  $fontFile,
  $text,
  $spacing,
  $wordSpacing,
  $splitRenderingConf,
  $sF = 1 
)

Printing text onto an image like the PHP function imageTTFText does but in addition it offers options for spacing of letters and words. Spacing is done by printing one char at a time and this means that the spacing is rather uneven and probably not very nice. See

Parameters
resource$im(See argument for PHP function imageTTFtext())
int$fontSize(See argument for PHP function imageTTFtext())
int$angle(See argument for PHP function imageTTFtext())
int$x(See argument for PHP function imageTTFtext())
int$y(See argument for PHP function imageTTFtext())
int$Fcolor(See argument for PHP function imageTTFtext())
string$fontFile(See argument for PHP function imageTTFtext())
string$text(See argument for PHP function imageTTFtext()). UTF-8 string, possibly with entities in.
int$spacingThe spacing of letters in pixels
int$wordSpacingThe spacing of words in pixels
array$splitRenderingConfArray
int$sFScale factor
Returns
void private

Definition at line 897 of file GraphicalFunctions.php.

References GraphicalFunctions\ImageTTFBBoxWrapper(), GraphicalFunctions\ImageTTFTextWrapper(), and GraphicalFunctions\singleChars().

Referenced by GraphicalFunctions\makeText().

splitString (   $string,
  $splitRendering,
  $fontSize,
  $fontFile 
)

Splitting a string for ImageTTFBBox up into an array where each part has its own configuration options.

Parameters
string$stringUTF-8 string
array$splitRenderingSplit-rendering configuration from GIFBUILDER TEXT object.
int$fontSizeCurrent fontsize
string$fontFileCurrent font file
Returns
array Array with input string splitted according to configuration

Definition at line 1069 of file GraphicalFunctions.php.

References GeneralUtility\inList(), GeneralUtility\intExplode(), GraphicalFunctions\singleChars(), and GeneralUtility\trimExplode().

Referenced by GraphicalFunctions\ImageTTFBBoxWrapper(), and GraphicalFunctions\ImageTTFTextWrapper().

txtPosition (   $conf,
  $workArea,
  $BB 
)

Calculates text position for printing the text onto the image based on configuration like alignment and workarea.

Parameters
array$confTypoScript array for the TEXT GIFBUILDER object
array$workAreaWorkarea definition
array$BBBounding box information, was set in ::start()
Returns
array [0]=x, [1]=y, [2]=w, [3]=h private
See Also
makeText()

Definition at line 713 of file GraphicalFunctions.php.

References GraphicalFunctions\$workArea, GraphicalFunctions\applyOffset(), GraphicalFunctions\calcBBox(), and GeneralUtility\intExplode().

Referenced by GraphicalFunctions\makeText().

unifyColors ( $img,
  $colArr,
  $closest = false 
)

Unifies all colors given in the colArr color array to the first color in the array.

Parameters
resource$imgImage resource
array$colArrArray containing RGB color arrays
bool$closest
Returns
int The index of the unified color

Definition at line 3006 of file GraphicalFunctions.php.

References GraphicalFunctions\convertColor(), GraphicalFunctions\hexColor(), GraphicalFunctions\imageCreateFromFile(), GraphicalFunctions\imageMagickExec(), and GraphicalFunctions\randomName().

Referenced by GifBuilder\make().

v5_blur (   $factor)

Returns the IM command for blurring with ImageMagick 5 (when $this->V5_EFFECTS is set). Uses $this->im5fx_blurSteps for translation of the factor to an actual command.

Parameters
int$factorThe blurring factor, 0-100 (effectively in 10 steps)
Returns
string The blurring command, eg. " -blur 3x4
See Also
makeText(), IMparams(), v5_sharpen()

Definition at line 2003 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange().

Referenced by GraphicalFunctions\IMparams(), and GraphicalFunctions\makeShadow().

v5_sharpen (   $factor)

Returns the IM command for sharpening with ImageMagick 5 (when $this->V5_EFFECTS is set). Uses $this->im5fx_sharpenSteps for translation of the factor to an actual command.

Parameters
int$factorThe sharpening factor, 0-100 (effectively in 10 steps)
Returns
string The sharpening command, eg. " -sharpen 3x4
See Also
makeText(), IMparams(), v5_blur()

Definition at line 1984 of file GraphicalFunctions.php.

References MathUtility\forceIntegerInRange().

Referenced by GraphicalFunctions\IMparams(), GraphicalFunctions\init(), and GraphicalFunctions\makeText().

Member Data Documentation

$absPrefix = ''

Definition at line 225 of file GraphicalFunctions.php.

$allowedColorSpaceNames
protected
Initial value:
= array(
'CMY',
'CMYK',
'Gray',
'HCL',
'HSB',
'HSL',
'HWB',
'Lab',
'LCH',
'LMS',
'Log',
'Luv',
'OHTA',
'Rec601Luma',
'Rec601YCbCr',
'Rec709Luma',
'Rec709YCbCr',
'RGB',
'sRGB',
'Transparent',
'XYZ',
'YCbCr',
'YCC',
'YIQ',
'YCbCr',
'YUV'
)

Definition at line 69 of file GraphicalFunctions.php.

$alternativeOutputKey = ''

Definition at line 192 of file GraphicalFunctions.php.

$cmds
Initial value:
= array(
'jpg' => '',
'jpeg' => '',
'gif' => '',
'png' => '-colors 64'
)

Definition at line 128 of file GraphicalFunctions.php.

$colMap
Initial value:
= array(
'aqua' => array(0, 255, 255),
'black' => array(0, 0, 0),
'blue' => array(0, 0, 255),
'fuchsia' => array(255, 0, 255),
'gray' => array(128, 128, 128),
'green' => array(0, 128, 0),
'lime' => array(0, 255, 0),
'maroon' => array(128, 0, 0),
'navy' => array(0, 0, 128),
'olive' => array(128, 128, 0),
'purple' => array(128, 0, 128),
'red' => array(255, 0, 0),
'silver' => array(192, 192, 192),
'teal' => array(0, 128, 128),
'yellow' => array(255, 255, 0),
'white' => array(255, 255, 255)
)

Definition at line 260 of file GraphicalFunctions.php.

$colorspace = 'RGB'
protected

Definition at line 62 of file GraphicalFunctions.php.

$csConvObj

Definition at line 284 of file GraphicalFunctions.php.

$dontCheckForExistingTempFile = 0

Definition at line 169 of file GraphicalFunctions.php.

$dontCompress = 0

Definition at line 176 of file GraphicalFunctions.php.

$dontUnlinkTempFiles = 0

Definition at line 183 of file GraphicalFunctions.php.

$filenamePrefix = ''

Definition at line 155 of file GraphicalFunctions.php.

$gdlibExtensions = ''

Definition at line 48 of file GraphicalFunctions.php.

$gifExtension = 'gif'
$im5fx_blurSteps = '1x2,2x2,3x2,4x3,5x3,5x4,6x4,7x5,8x5,9x5'

Definition at line 239 of file GraphicalFunctions.php.

$im5fx_sharpenSteps = '1x2,2x2,3x2,2x3,3x3,4x3,3x4,4x4,4x5,5x5'

Definition at line 246 of file GraphicalFunctions.php.

$IM_commands = array()

Definition at line 199 of file GraphicalFunctions.php.

$imageFileExt = 'gif,jpg,jpeg,png,tif,bmp,tga,pcx,ai,pdf'

Definition at line 111 of file GraphicalFunctions.php.

$imageMagickConvert_forceFileNameBody = ''

Definition at line 162 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\imageMagickConvert().

$mayScaleUp = 1

Definition at line 148 of file GraphicalFunctions.php.

$nativeCharset = ''

Definition at line 291 of file GraphicalFunctions.php.

$NO_IM_EFFECTS = ''

Definition at line 123 of file GraphicalFunctions.php.

$NO_IMAGE_MAGICK = ''

Definition at line 138 of file GraphicalFunctions.php.

$noFramePrepended = 0

Definition at line 34 of file GraphicalFunctions.php.

$pixelLimitGif = 10000

Definition at line 253 of file GraphicalFunctions.php.

$png_truecolor = false

Definition at line 55 of file GraphicalFunctions.php.

$saveAlphaLayer = false
protected

Definition at line 211 of file GraphicalFunctions.php.

$scalecmd = '-geometry'

Definition at line 232 of file GraphicalFunctions.php.

$tempPath = 'typo3temp/'

Definition at line 218 of file GraphicalFunctions.php.

Referenced by GraphicalFunctions\createTempSubDir().

$truecolorColors = 16777215

Definition at line 103 of file GraphicalFunctions.php.

$V5_EFFECTS = 0

Definition at line 143 of file GraphicalFunctions.php.

$webImageExt = 'gif,jpg,jpeg,png'

Definition at line 118 of file GraphicalFunctions.php.

$workArea = array()