‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\Imaging\GifBuilder Class Reference

Public Member Functions

 __construct ()
 
 start (array $conf, array $data)
 
ImageResource null gifBuild ()
 
 makeText (\GdImage &$im, array $conf, array $workArea)
 
 makeShadow (\GdImage &$im, array $conf, array $workArea, array $txtConf)
 
 makeBox (\GdImage &$im, array $conf, array $workArea)
 
 makeEllipse (\GdImage &$im, array $conf, array $workArea)
 
string calcOffset (string $string)
 
array calcBBox (array $conf)
 
bool ImageWrite (\GdImage &$destImg, string $theImage, int $quality=0)
 
GdImage imageCreateFromFile (string $sourceImg)
 
 getTemporaryImageWithText (string $filename, string $textline1, string $textline2='', string $textline3='')
 
 getGraphicalFunctions ()
 

Public Attributes

array $setup = []
 

Protected Member Functions

 output (\GdImage $gdImage, string $file)
 
 make ()
 
 maskImageOntoImage (\GdImage &$im, array $conf, array $workArea)
 
 copyImageOntoImage (\GdImage &$im, array $conf, array $workArea)
 
 makeOutline (\GdImage &$im, array $conf, array $workArea, array $txtConf)
 
 makeEmboss (\GdImage &$im, array $conf, array $workArea, array $txtConf)
 
 makeEffect (\GdImage &$im, array $conf)
 
 adjust (\GdImage &$im, array $conf)
 
 crop (\GdImage &$im, array $conf)
 
 scale (\GdImage &$im, array $conf)
 
 setWorkArea (string $workArea)
 
array null checkTextObj (array $conf)
 
ImageResource null getResource (string|File $file, array $fileArray)
 
string null checkFile (string $file)
 
 fileName ()
 
 extension ()
 
int calculateValue (string $string)
 
string calculateFunctions (string $string)
 
int calculateMaximum (string $value)
 
array objPosition (array $conf, array $workArea, array $BB)
 
array applyOffset (array $cords, array $offset)
 
 copyGifOntoGif (\GdImage &$im, \GdImage &$cpImg, array $conf, array $workArea)
 
 imagecopyresized (\GdImage &$dstImg, \GdImage &$srcImg, int $dstX, int $dstY, int $srcX, int $srcY, int $dstWidth, int $dstHeight, int $srcWidth, int $srcHeight)
 
 circleOffset (int $distance, int $iterations)
 
string IMparams (string $setup)
 
string hexColor (array $color)
 
int unifyColors (\GdImage &$img, array $colArr, bool $closest)
 
array convertColor (string $string)
 
array txtPosition (array $conf, array $workArea, array $BB)
 
 SpacedImageTTFText (\GdImage &$im, int $fontSize, int $angle, int $x, int $y, int $Fcolor, string $fontFile, string $text, int $spacing, int $wordSpacing, array $splitRenderingConf, int $sF=1)
 
int fontResize (array $conf)
 
array ImageTTFBBoxWrapper (int $fontSize, int $angle, string $fontFile, string $string, array $splitRendering, int $sF=1)
 
 ImageTTFTextWrapper (\GdImage &$im, int $fontSize, int $angle, int $x, int $y, int $color, string $fontFile, string $string, array $splitRendering, int $sF=1)
 
array splitString (string $string, array $splitRendering, int $fontSize, string $fontFile)
 
array calcWordSpacing (array $conf, int $scaleFactor=1)
 
int getTextScalFactor (array $conf)
 
 renderTTFText (\GdImage &$im, int $fontSize, int $angle, int $x, int $y, int $color, string $fontFile, string $string, array $splitRendering, array $conf, int $sF=1)
 
 getWordPairsForLineBreak (string $string)
 
 getRenderedTextWidth (string $text, array $conf)
 
int getBreakSpace (array $conf, array $boundingBox=[])
 
float compensateFontSizeiBasedOnFreetypeDpi (float $fontSize)
 
 autolevels (\GdImage &$im)
 
 outputLevels (\GdImage &$im, int $low, int $high)
 
 inputLevels (\GdImage &$im, int $low, int $high)
 
 applyImageMagickToPHPGif (\GdImage &$im, string $command)
 

Protected Attributes

array $combinedTextStrings = []
 
array $combinedFileNames = []
 
array $data = []
 
array $objBB = []
 
array $charRangeMap = []
 
array $XY = []
 
ContentObjectRenderer $cObj = null
 
array $workArea = []
 
array $defaultWorkArea = []
 
bool $saveAlphaLayer = false
 
array $colMap
 
int $w = 0
 
int $h = 0
 
array $offset
 
array $gdlibExtensions = []
 
CharsetConverter $csConvObj
 
GraphicalFunctions $imageService
 
bool $processorEffectsEnabled = false
 
int $jpegQuality = 85
 
int $webpQuality = 85
 

Detailed Description

GIFBUILDER

Generating image files from TypoScript Used by imgResource in TypoScript.

This class allows for advanced rendering of images with various layers of images, text and graphical primitives. The concept is known from TypoScript as "GIFBUILDER" where you can define a "numerical array" (TypoScript term as well) of "GIFBUILDER OBJECTS" (like "TEXT", "IMAGE", etc.) and they will be rendered onto an image one by one. The name "GIFBUILDER" comes from the time when GIF was the only file format supported. .png, .jpg and .webp files are just as well to create today (configured with TYPO3_CONF_VARS[GFX])

Here is an example of how to use this class:

$imageCreator = GeneralUtility::makeInstance(GifBuilder::class); $imageCreator->start($fileArray, $this->data); $theImage = $imageCreator->gifBuild(); return GeneralUtility::makeInstance(GraphicalFunctions::class)->getImageDimensions($theImage);

Definition at line 57 of file GifBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Imaging\GifBuilder::__construct ( )

Member Function Documentation

◆ adjust()

TYPO3\CMS\Frontend\Imaging\GifBuilder::adjust ( \GdImage &  $im,
array  $conf 
)
protected

Implements the "ADJUST" GIFBUILDER object

Parameters
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
See also
make()
‪autoLevels()
outputLevels()
inputLevels()

Definition at line 1085 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$setup, TYPO3\CMS\Frontend\Imaging\GifBuilder\autolevels(), TYPO3\CMS\Frontend\Imaging\GifBuilder\inputLevels(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\outputLevels().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ applyImageMagickToPHPGif()

TYPO3\CMS\Frontend\Imaging\GifBuilder::applyImageMagickToPHPGif ( \GdImage &  $im,
string  $command 
)
protected

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
\GdImage$im‪The image pointer (reference)
string$command‪The ImageMagick parameters. Like effects, scaling etc.

Definition at line 2562 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\imageCreateFromFile(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageWrite().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\makeEffect().

◆ applyOffset()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::applyOffset ( array  $cords,
array  $offset 
)
protected

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$cords‪Integer coordinates in key 0/1
array$offset‪Offset values in key 0/1
Returns
‪array Modified $cords array

Definition at line 1553 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$offset.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\makeOutline(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow(), TYPO3\CMS\Frontend\Imaging\GifBuilder\objPosition(), TYPO3\CMS\Frontend\Imaging\GifBuilder\setWorkArea(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\txtPosition().

◆ autolevels()

TYPO3\CMS\Frontend\Imaging\GifBuilder::autolevels ( \GdImage &  $im)
protected

Apply auto-levels to input image pointer

Parameters
\GdImage$im‪GDlib Image Pointer

Definition at line 2485 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\adjust().

◆ calcBBox()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::calcBBox ( array  $conf)

◆ calcOffset()

string TYPO3\CMS\Frontend\Imaging\GifBuilder::calcOffset ( string  $string)

Calculation of offset using "splitCalc" and insertion of dimensions from other GIFBUILDER objects.

Example: Input: 2+2, 2*3, 123, [10.w] Output: 4,6,123,45 (provided that the width of object in position 10 was 45 pixels wide)

Parameters
string$string‪The string to resolve/calculate the result of. The string is divided by a comma first and each resulting part is calculated into an integer.
Returns
‪string The resolved string with each part (separated by comma) returned separated by comma

Definition at line 1316 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\calculateFunctions(), TYPO3\CMS\Frontend\Imaging\GifBuilder\calculateValue(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calculateMaximum(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\start().

◆ calculateFunctions()

string TYPO3\CMS\Frontend\Imaging\GifBuilder::calculateFunctions ( string  $string)
protected

Calculates special functions:

  • ‪max([10.h], [20.h]) -> gets the maximum of the given values
Parameters
string$string‪The raw string with functions to be calculated
Returns
‪string The calculated values

Definition at line 1474 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\calculateMaximum().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calcOffset().

◆ calculateMaximum()

int TYPO3\CMS\Frontend\Imaging\GifBuilder::calculateMaximum ( string  $value)
protected

Calculates the maximum of a set of values defined like "[10.h],[20.h],1000"

Parameters
string$value‪The string to be used to calculate the maximum (e.g. "[10.h],[20.h],1000")
Returns
‪int The maximum value of the given comma separated and calculated values

Definition at line 1490 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\calcOffset(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calculateFunctions().

◆ calculateValue()

int TYPO3\CMS\Frontend\Imaging\GifBuilder::calculateValue ( string  $string)
protected

Calculates the value concerning the dimensions of objects.

Parameters
string$string‪The string to be calculated (e.g. "[20.h]+13")
Returns
‪int The calculated value (e.g. "23")
See also
calcOffset()

Definition at line 1425 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calcOffset().

◆ calcWordSpacing()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::calcWordSpacing ( array  $conf,
int  $scaleFactor = 1 
)
protected

Calculates the spacing and wordSpacing values

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

Definition at line 2337 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox(), TYPO3\CMS\Frontend\Imaging\GifBuilder\fontResize(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText().

◆ checkFile()

string null TYPO3\CMS\Frontend\Imaging\GifBuilder::checkFile ( string  $file)
protected

Returns the reference to a "resource" in TypoScript.

Parameters
string$file‪The resource value.
Returns
‪string|null Returns the relative filepath or null if it's invalid

Definition at line 1362 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\checkTextObj().

◆ checkTextObj()

array null TYPO3\CMS\Frontend\Imaging\GifBuilder::checkTextObj ( array  $conf)
protected

Initializing/Cleaning of TypoScript properties for TEXT GIFBUILDER objects

'cleans' TEXT-object; Checks fontfile and other vital setup Finds the title if its a 'variable' (instantiates a cObj and loads it with the ->data record) Performs caseshift if any.

Parameters
array$conf‪GIFBUILDER object TypoScript properties
Returns
‪array|null Modified $conf array IF the "text" property is not blank

Definition at line 1219 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$cObj, TYPO3\CMS\Core\Utility\PathUtility\basename(), TYPO3\CMS\Frontend\Imaging\GifBuilder\checkFile(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\start(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrapValue().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\start().

◆ circleOffset()

TYPO3\CMS\Frontend\Imaging\GifBuilder::circleOffset ( int  $distance,
int  $iterations 
)
protected

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

Parameters
int$distance‪Distance
int$iterations‪Iterations.
See also
makeOutline()

Definition at line 1669 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\makeOutline().

◆ compensateFontSizeiBasedOnFreetypeDpi()

float TYPO3\CMS\Frontend\Imaging\GifBuilder::compensateFontSizeiBasedOnFreetypeDpi ( float  $fontSize)
protected

Function to compensate for DPI resolution. FreeType 2 always has 96 dpi, so it is hard-coded at this place.

Parameters
float$fontSize‪font size for freetype function call
Returns
‪float compensated font size based on 96 dpi

Definition at line 2470 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFBBoxWrapper(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFTextWrapper().

◆ convertColor()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::convertColor ( string  $string)
protected

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 1847 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\crop(), TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFTextWrapper(), TYPO3\CMS\Frontend\Imaging\GifBuilder\make(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeBox(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeEllipse(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\unifyColors().

◆ copyGifOntoGif()

TYPO3\CMS\Frontend\Imaging\GifBuilder::copyGifOntoGif ( \GdImage &  $im,
\GdImage &  $cpImg,
array  $conf,
array  $workArea 
)
protected

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

Parameters
\GdImage$im‪GDlib image pointer, destination (bottom image)
\GdImage$cpImg‪GDlib image pointer, source (top image)
array$conf‪TypoScript array with the properties for the IMAGE GIFBUILDER object. Only used for the "tile" property value.
array$workArea‪Work area

Definition at line 1568 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$h, TYPO3\CMS\Frontend\Imaging\GifBuilder\$w, TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Frontend\Imaging\GifBuilder\imagecopyresized(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\objPosition().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\copyImageOntoImage(), TYPO3\CMS\Frontend\Imaging\GifBuilder\crop(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\maskImageOntoImage().

◆ copyImageOntoImage()

TYPO3\CMS\Frontend\Imaging\GifBuilder::copyImageOntoImage ( \GdImage &  $im,
array  $conf,
array  $workArea 
)
protected

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

Parameters
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
array$workArea‪The current working area coordinates.
See also
make()
maskImageOntoImage()

Definition at line 742 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\copyGifOntoGif(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\imageCreateFromFile().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ crop()

TYPO3\CMS\Frontend\Imaging\GifBuilder::crop ( \GdImage &  $im,
array  $conf 
)
protected

◆ extension()

TYPO3\CMS\Frontend\Imaging\GifBuilder::extension ( )
protected

Returns the file extension used in the filename

Definition at line 1408 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\fileName().

◆ fileName()

TYPO3\CMS\Frontend\Imaging\GifBuilder::fileName ( )
protected

Calculates the GIFBUILDER output filename based on a serialized, hashed value of this->setup and prefixes the original filename. The filename gets an additional prefix (max 100 characters), something like "GB_MD5HASH_myfilename_is_very_long_and_such.jpg".

Definition at line 1377 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$combinedFileNames, TYPO3\CMS\Frontend\Imaging\GifBuilder\$combinedTextStrings, TYPO3\CMS\Frontend\Imaging\GifBuilder\$data, TYPO3\CMS\Frontend\Imaging\GifBuilder\$h, TYPO3\CMS\Frontend\Imaging\GifBuilder\$offset, TYPO3\CMS\Frontend\Imaging\GifBuilder\$w, TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\$XY, and TYPO3\CMS\Frontend\Imaging\GifBuilder\extension().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\gifBuild().

◆ fontResize()

int TYPO3\CMS\Frontend\Imaging\GifBuilder::fontResize ( array  $conf)
protected

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

Parameters
array$conf‪The TypoScript properties of the TEXT GIFBUILDER object
Returns
‪int The new fontSize
See also
start()

Definition at line 2075 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\calcWordSpacing(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFBBoxWrapper().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\start().

◆ getBreakSpace()

int TYPO3\CMS\Frontend\Imaging\GifBuilder::getBreakSpace ( array  $conf,
array  $boundingBox = [] 
)
protected

Gets the break space for each new line.

Parameters
array$conf‪TypoScript configuration for the currently rendered object
array$boundingBox‪The bounding box for the currently rendered object
Returns
‪int The break space

Definition at line 2449 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\renderTTFText().

◆ getGraphicalFunctions()

TYPO3\CMS\Frontend\Imaging\GifBuilder::getGraphicalFunctions ( )

Only used for ext:install, not part of TYPO3 Core API.

Definition at line 2715 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$imageService.

◆ getRenderedTextWidth()

TYPO3\CMS\Frontend\Imaging\GifBuilder::getRenderedTextWidth ( string  $text,
array  $conf 
)
protected

◆ getResource()

ImageResource null TYPO3\CMS\Frontend\Imaging\GifBuilder::getResource ( string|File  $file,
array  $fileArray 
)
protected

Returns an "imgResource" creating an instance of the ContentObjectRenderer class and calling ContentObjectRenderer::getImgResource

Parameters
string | File$file‪Filename value OR the string "GIFBUILDER", see documentation in TSref for the "datatype" called "imgResource" - can also be a FAL file
array$fileArray‪TypoScript properties passed to the function. Either GIFBUILDER properties or imgResource properties, depending on the value of $file (whether that is "GIFBUILDER" or a file reference)
Returns
‪ImageResource|null Returns the ImageResource DTO with file information from ContentObjectRenderer::getImgResource() - or NULL
See also
ContentObjectRenderer::getImgResource()

Definition at line 1339 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$cObj, TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getImgResource(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\start().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\start().

◆ getTemporaryImageWithText()

TYPO3\CMS\Frontend\Imaging\GifBuilder::getTemporaryImageWithText ( string  $filename,
string  $textline1,
string  $textline2 = '',
string  $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$filename‪Name of the file
string$textline1‪Text line 1
string$textline2‪Text line 2
string$textline3‪Text line 3
Exceptions

Definition at line 2682 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath().

◆ getTextScalFactor()

int TYPO3\CMS\Frontend\Imaging\GifBuilder::getTextScalFactor ( array  $conf)
protected

Calculates and returns the niceText.scaleFactor

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

Definition at line 2353 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox().

◆ getWordPairsForLineBreak()

TYPO3\CMS\Frontend\Imaging\GifBuilder::getWordPairsForLineBreak ( string  $string)
protected

Gets the word pairs used for automatic line breaks.

Definition at line 2414 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\renderTTFText().

◆ gifBuild()

ImageResource null TYPO3\CMS\Frontend\Imaging\GifBuilder::gifBuild ( )

Initiates the image file generation if ->setup is TRUE and if the file did not exist already. Gets filename from fileName() and if file exists in typo3temp/assets/images/ dir it will- of course - not be rendered again. Otherwise rendering means calling ->make(), then ->output(), then destroys the image and returns the ImageResource DTO.

Returns
‪ImageResource|null Returns the ImageResource DTO with file information from ContentObjectRenderer::getImgResource() - or NULL
See also
make()
fileName()

Definition at line 415 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\fileName(), TYPO3\CMS\Core\Core\Environment\getPublicPath(), TYPO3\CMS\Frontend\Imaging\GifBuilder\make(), TYPO3\CMS\Core\Utility\GeneralUtility\mkdir_deep(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\output().

◆ hexColor()

string TYPO3\CMS\Frontend\Imaging\GifBuilder::hexColor ( array  $color)
protected

Returns the HEX color value for an RGB color array

Parameters
array$color‪RGB color array
Returns
‪string HEX color value

Definition at line 1771 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\unifyColors().

◆ imagecopyresized()

TYPO3\CMS\Frontend\Imaging\GifBuilder::imagecopyresized ( \GdImage &  $dstImg,
\GdImage &  $srcImg,
int  $dstX,
int  $dstY,
int  $srcX,
int  $srcY,
int  $dstWidth,
int  $dstHeight,
int  $srcWidth,
int  $srcHeight 
)
protected

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
\GdImage$dstImg‪Destination image
\GdImage$srcImg‪Source image
int$dstX‪Destination x-coordinate
int$dstY‪Destination y-coordinate
int$srcX‪Source x-coordinate
int$srcY‪Source y-coordinate
int$dstWidth‪Destination width
int$dstHeight‪Destination height
int$srcWidth‪Source width
int$srcHeight‪Source height

Definition at line 1646 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\copyGifOntoGif(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow().

◆ imageCreateFromFile()

GdImage TYPO3\CMS\Frontend\Imaging\GifBuilder::imageCreateFromFile ( string  $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$sourceImg‪Image filename
Returns
‪\GdImage Image Resource pointer

Definition at line 2631 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\applyImageMagickToPHPGif(), TYPO3\CMS\Frontend\Imaging\GifBuilder\copyImageOntoImage(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText(), TYPO3\CMS\Frontend\Imaging\GifBuilder\maskImageOntoImage(), TYPO3\CMS\Frontend\Imaging\GifBuilder\scale(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\unifyColors().

◆ ImageTTFBBoxWrapper()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::ImageTTFBBoxWrapper ( int  $fontSize,
int  $angle,
string  $fontFile,
string  $string,
array  $splitRendering,
int  $sF = 1 
)
protected

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$splitRendering‪Split-rendering configuration
int$sF‪Scale factor
Returns
‪array Information array.

Definition at line 2116 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\compensateFontSizeiBasedOnFreetypeDpi(), debug(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\splitString().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox(), TYPO3\CMS\Frontend\Imaging\GifBuilder\fontResize(), TYPO3\CMS\Frontend\Imaging\GifBuilder\getRenderedTextWidth(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\SpacedImageTTFText().

◆ ImageTTFTextWrapper()

TYPO3\CMS\Frontend\Imaging\GifBuilder::ImageTTFTextWrapper ( \GdImage &  $im,
int  $fontSize,
int  $angle,
int  $x,
int  $y,
int  $color,
string  $fontFile,
string  $string,
array  $splitRendering,
int  $sF = 1 
)
protected

Wrapper for ImageTTFText

Parameters
\GdImage$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$splitRendering‪Split-rendering configuration
int$sF‪Scale factor

Definition at line 2158 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\compensateFontSizeiBasedOnFreetypeDpi(), TYPO3\CMS\Frontend\Imaging\GifBuilder\convertColor(), debug(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\splitString().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\renderTTFText(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\SpacedImageTTFText().

◆ ImageWrite()

bool TYPO3\CMS\Frontend\Imaging\GifBuilder::ImageWrite ( \GdImage &  $destImg,
string  $theImage,
int  $quality = 0 
)

Writes the input GDlib image pointer to file

Parameters
\GdImage$destImg‪The GDlib image resource pointer
string$theImage‪The absolute file path to write to
int$quality‪The 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 2589 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\fixPermissions().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\applyImageMagickToPHPGif(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText(), TYPO3\CMS\Frontend\Imaging\GifBuilder\maskImageOntoImage(), TYPO3\CMS\Frontend\Imaging\GifBuilder\output(), TYPO3\CMS\Frontend\Imaging\GifBuilder\scale(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\unifyColors().

◆ IMparams()

string TYPO3\CMS\Frontend\Imaging\GifBuilder::IMparams ( string  $setup)
protected

Creating ImageMagick parameters from TypoScript property

Parameters
string$setup‪A string with effect keywords=value pairs separated by "|
Returns
‪string ImageMagick prepared parameters.
See also
makeEffect()

Definition at line 1695 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$setup, TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\makeEffect().

◆ inputLevels()

TYPO3\CMS\Frontend\Imaging\GifBuilder::inputLevels ( \GdImage &  $im,
int  $low,
int  $high 
)
protected

Apply input levels to input image pointer (increasing contrast)

Parameters
\GdImage$im‪GDlib Image Pointer
int$low‪The "low" value (close to 0)
int$high‪The "high" value (close to 255)

Definition at line 2538 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\adjust(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow().

◆ make()

◆ makeBox()

TYPO3\CMS\Frontend\Imaging\GifBuilder::makeBox ( \GdImage &  $im,
array  $conf,
array  $workArea 
)

Implements the "BOX" GIFBUILDER object

Parameters
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
array$workArea‪The current working area coordinates.
See also
make()

Definition at line 1007 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\convertColor(), TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\objPosition().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ makeEffect()

TYPO3\CMS\Frontend\Imaging\GifBuilder::makeEffect ( \GdImage &  $im,
array  $conf 
)
protected

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

Parameters
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
See also
make()
applyImageMagickToPHPGif()

Definition at line 1067 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\applyImageMagickToPHPGif(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\IMparams().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ makeEllipse()

TYPO3\CMS\Frontend\Imaging\GifBuilder::makeEllipse ( \GdImage &  $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
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
array$workArea‪The current working area coordinates.
See also
make()

Definition at line 1046 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\convertColor(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\objPosition().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ makeEmboss()

TYPO3\CMS\Frontend\Imaging\GifBuilder::makeEmboss ( \GdImage &  $im,
array  $conf,
array  $workArea,
array  $txtConf 
)
protected

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

Parameters
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
array$workArea‪The current working area coordinates.
array$txtConf‪TypoScript array with configuration for the associated TEXT GIFBUILDER object.
See also
make()
makeShadow()

Definition at line 888 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ makeOutline()

TYPO3\CMS\Frontend\Imaging\GifBuilder::makeOutline ( \GdImage &  $im,
array  $conf,
array  $workArea,
array  $txtConf 
)
protected

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

Parameters
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
array$workArea‪The current working area coordinates.
array$txtConf‪TypoScript array with configuration for the associated TEXT GIFBUILDER object.
See also
make()
makeText()

Definition at line 858 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\applyOffset(), TYPO3\CMS\Frontend\Imaging\GifBuilder\circleOffset(), TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ makeShadow()

TYPO3\CMS\Frontend\Imaging\GifBuilder::makeShadow ( \GdImage &  $im,
array  $conf,
array  $workArea,
array  $txtConf 
)

◆ makeText()

◆ maskImageOntoImage()

TYPO3\CMS\Frontend\Imaging\GifBuilder::maskImageOntoImage ( \GdImage &  $im,
array  $conf,
array  $workArea 
)
protected

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
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
array$workArea‪The current working area coordinates.
See also
make()

Definition at line 657 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$h, TYPO3\CMS\Frontend\Imaging\GifBuilder\$w, TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\copyGifOntoGif(), TYPO3\CMS\Frontend\Imaging\GifBuilder\imageCreateFromFile(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageWrite().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ objPosition()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::objPosition ( array  $conf,
array  $workArea,
array  $BB 
)
protected

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$conf‪TypoScript configuration for a GIFBUILDER object
array$workArea‪Workarea definition
array$BB‪BB (Bounding box) array. Not just used for TEXT objects but also for others
Returns
‪array [0]=x, [1]=y, [2]=w, [3]=h
See also
copyGifOntoGif()
makeBox()
crop()

Definition at line 1508 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$h, TYPO3\CMS\Frontend\Imaging\GifBuilder\$w, TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\applyOffset(), and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\copyGifOntoGif(), TYPO3\CMS\Frontend\Imaging\GifBuilder\crop(), TYPO3\CMS\Frontend\Imaging\GifBuilder\makeBox(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\makeEllipse().

◆ output()

TYPO3\CMS\Frontend\Imaging\GifBuilder::output ( \GdImage  $gdImage,
string  $file 
)
protected

Writing the image pointer, to file based on the extension of the input filename. Uses $this->setup['quality'] for jpg images to reduce size/quality if needed.

Parameters
string$file‪The absolute filename to write to
See also
gifBuild()

Definition at line 446 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageWrite().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\gifBuild().

◆ outputLevels()

TYPO3\CMS\Frontend\Imaging\GifBuilder::outputLevels ( \GdImage &  $im,
int  $low,
int  $high 
)
protected

Apply output levels to input image pointer (decreasing contrast)

Parameters
\GdImage$im‪GDlib Image Pointer
int$low‪The "low" value (close to 0)
int$high‪The "high" value (close to 255)

Definition at line 2514 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\adjust(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\makeShadow().

◆ renderTTFText()

TYPO3\CMS\Frontend\Imaging\GifBuilder::renderTTFText ( \GdImage &  $im,
int  $fontSize,
int  $angle,
int  $x,
int  $y,
int  $color,
string  $fontFile,
string  $string,
array  $splitRendering,
array  $conf,
int  $sF = 1 
)
protected

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

Parameters
\GdImage$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$splitRendering‪Split-rendering configuration
array$conf‪The configuration
int$sF‪Scale factor

Definition at line 2378 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\getBreakSpace(), TYPO3\CMS\Frontend\Imaging\GifBuilder\getRenderedTextWidth(), TYPO3\CMS\Frontend\Imaging\GifBuilder\getWordPairsForLineBreak(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFTextWrapper().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText().

◆ scale()

TYPO3\CMS\Frontend\Imaging\GifBuilder::scale ( \GdImage &  $im,
array  $conf 
)
protected

Implements the "SCALE" GIFBUILDER object

Parameters
\GdImage$im‪GDlib image pointer
array$conf‪TypoScript array with configuration for the GIFBUILDER object.
See also
make()

Definition at line 1158 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\imageCreateFromFile(), TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageWrite(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\setWorkArea().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ setWorkArea()

TYPO3\CMS\Frontend\Imaging\GifBuilder::setWorkArea ( string  $workArea)
protected

◆ SpacedImageTTFText()

TYPO3\CMS\Frontend\Imaging\GifBuilder::SpacedImageTTFText ( \GdImage &  $im,
int  $fontSize,
int  $angle,
int  $x,
int  $y,
int  $Fcolor,
string  $fontFile,
string  $text,
int  $spacing,
int  $wordSpacing,
array  $splitRenderingConf,
int  $sF = 1 
)
protected

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
\GdImage$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$spacing‪The spacing of letters in pixels
int$wordSpacing‪The spacing of words in pixels
array$splitRenderingConf‪Array
int$sF‪Scale factor

Definition at line 2043 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFBBoxWrapper(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFTextWrapper().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText().

◆ splitString()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::splitString ( string  $string,
array  $splitRendering,
int  $fontSize,
string  $fontFile 
)
protected

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

Parameters
string$string‪UTF-8 string
array$splitRendering‪Split-rendering configuration from GIFBUILDER TEXT object.
int$fontSize‪Current fontsize
string$fontFile‪Current font file
Returns
‪array Array with input string splitted according to configuration

Definition at line 2202 of file GifBuilder.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFBBoxWrapper(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageTTFTextWrapper().

◆ start()

TYPO3\CMS\Frontend\Imaging\GifBuilder::start ( array  $conf,
array  $data 
)

Initialization of the GIFBUILDER objects, in particular TEXT and IMAGE. This includes finding the bounding box, setting dimensions and offset values before the actual rendering is started. Modifies the ->setup, ->objBB internal arrays

Parameters
array$conf‪TypoScript properties for the GIFBUILDER session. Stored internally in the variable ->setup
array$data‪The current data record from \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer. Stored internally in the variable ->data
See also
ContentObjectRenderer::getImgResource()

Definition at line 215 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$data, TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\$XY, TYPO3\CMS\Core\Utility\PathUtility\basename(), TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox(), TYPO3\CMS\Frontend\Imaging\GifBuilder\calcOffset(), TYPO3\CMS\Frontend\Imaging\GifBuilder\checkTextObj(), TYPO3\CMS\Frontend\Imaging\GifBuilder\fontResize(), TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange(), TYPO3\CMS\Frontend\Imaging\GifBuilder\getResource(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\setWorkArea().

◆ txtPosition()

array TYPO3\CMS\Frontend\Imaging\GifBuilder::txtPosition ( array  $conf,
array  $workArea,
array  $BB 
)
protected

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

Parameters
array$conf‪TypoScript array for the TEXT GIFBUILDER object
array$workArea‪Work area definition
array$BB‪Bounding box information, was set in start()
Returns
‪array [0]=x, [1]=y, [2]=w, [3]=h
See also
makeText()

Definition at line 1899 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\$w, TYPO3\CMS\Frontend\Imaging\GifBuilder\$workArea, TYPO3\CMS\Frontend\Imaging\GifBuilder\applyOffset(), TYPO3\CMS\Frontend\Imaging\GifBuilder\calcBBox(), and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\makeText().

◆ unifyColors()

int TYPO3\CMS\Frontend\Imaging\GifBuilder::unifyColors ( \GdImage &  $img,
array  $colArr,
bool  $closest 
)
protected

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

Parameters
\GdImage$img‪Image resource
array$colArr‪Array containing RGB color arrays
Returns
‪int The index of the unified color

Definition at line 1795 of file GifBuilder.php.

References TYPO3\CMS\Frontend\Imaging\GifBuilder\convertColor(), TYPO3\CMS\Frontend\Imaging\GifBuilder\hexColor(), TYPO3\CMS\Frontend\Imaging\GifBuilder\imageCreateFromFile(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\ImageWrite().

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

Member Data Documentation

◆ $charRangeMap

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$charRangeMap = []
protected

Definition at line 82 of file GifBuilder.php.

◆ $cObj

ContentObjectRenderer TYPO3\CMS\Frontend\Imaging\GifBuilder::$cObj = null
protected

◆ $colMap

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$colMap
protected
Initial value:
= [
'aqua' => [0, 255, 255],
'black' => [0, 0, 0],
'blue' => [0, 0, 255],
'fuchsia' => [255, 0, 255],
'gray' => [128, 128, 128],
'green' => [0, 128, 0],
'lime' => [0, 255, 0],
'maroon' => [128, 0, 0],
'navy' => [0, 0, 128],
'olive' => [128, 128, 0],
'purple' => [128, 0, 128],
'red' => [255, 0, 0],
'silver' => [192, 192, 192],
'teal' => [0, 128, 128],
'yellow' => [255, 255, 0],
'white' => [255, 255, 255],
]

Definition at line 110 of file GifBuilder.php.

◆ $combinedFileNames

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$combinedFileNames = []
protected

Definition at line 71 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\fileName().

◆ $combinedTextStrings

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$combinedTextStrings = []
protected

Definition at line 64 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\fileName().

◆ $csConvObj

CharsetConverter TYPO3\CMS\Frontend\Imaging\GifBuilder::$csConvObj
protected

Definition at line 158 of file GifBuilder.php.

◆ $data

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$data = []
protected

This is the array from which data->field: [key] is fetched. So this is the current record!

Definition at line 76 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\fileName(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\start().

◆ $defaultWorkArea

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$defaultWorkArea = []
protected

Definition at line 98 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\make().

◆ $gdlibExtensions

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$gdlibExtensions = []
protected

Definition at line 156 of file GifBuilder.php.

◆ $h

◆ $imageService

GraphicalFunctions TYPO3\CMS\Frontend\Imaging\GifBuilder::$imageService
protected

◆ $jpegQuality

int TYPO3\CMS\Frontend\Imaging\GifBuilder::$jpegQuality = 85
protected

Definition at line 169 of file GifBuilder.php.

◆ $objBB

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$objBB = []
protected

Definition at line 77 of file GifBuilder.php.

◆ $offset

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$offset
protected

◆ $processorEffectsEnabled

bool TYPO3\CMS\Frontend\Imaging\GifBuilder::$processorEffectsEnabled = false
protected

Enable ImageMagick effects, disabled by default as IM5+ effects slow down the image generation

Definition at line 164 of file GifBuilder.php.

◆ $saveAlphaLayer

bool TYPO3\CMS\Frontend\Imaging\GifBuilder::$saveAlphaLayer = false
protected

Preserve the alpha transparency layer of read PNG images

Definition at line 103 of file GifBuilder.php.

◆ $setup

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$setup = []

This holds the operational setup. Basically this is a TypoScript array with properties.

Definition at line 135 of file GifBuilder.php.

Referenced by TYPO3\CMS\Frontend\Imaging\GifBuilder\adjust(), and TYPO3\CMS\Frontend\Imaging\GifBuilder\IMparams().

◆ $w

◆ $webpQuality

int TYPO3\CMS\Frontend\Imaging\GifBuilder::$webpQuality = 85
protected

Definition at line 173 of file GifBuilder.php.

◆ $workArea

◆ $XY

array TYPO3\CMS\Frontend\Imaging\GifBuilder::$XY = []
protected