[BUGFIX] Replace calls of tslib_gifbuilder with namespaced class
authorNicole Cordes <nicole@cordes.co>
Mon, 19 Nov 2012 17:33:21 +0000 (18:33 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 19 Nov 2012 19:07:02 +0000 (20:07 +0100)
In some functions the old class tslib_gifbuilder is still called and
should be replaces with the namespaced class.

Change-Id: I313ce18f667e0f7cc636422d9a784433851d59d8
Fixes: #43111
Releases: 6.0
Reviewed-on: http://review.typo3.org/16577
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Classes/Resource/Service/FileProcessingService.php
typo3/sysext/core/Classes/Resource/Service/ImageProcessingService.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/ImageTextContentObject.php
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php

index 427ae21..f88b323 100644 (file)
@@ -41,7 +41,7 @@ namespace TYPO3\CMS\Core\Imaging;
  * $TYPO3_CONF_VARS['GFX']['gdlib_2'] = 0,     // String/Boolean. Set this if you are using the new GDlib 2.0.1+. If you don't set this flag and still use GDlib2, you might encounter strange behaviours like black images etc. This feature might take effect only if ImageMagick is installed and working as well! You can also use the value "no_imagecopyresized_fix" - in that case it will NOT try to fix a known issue where "imagecopyresized" does not work correctly.
  *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- * @see tslib_gifBuilder
+ * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder
  */
 class GraphicalFunctions {
 
@@ -376,7 +376,7 @@ class GraphicalFunctions {
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @param array $workArea The current working area coordinates.
         * @return void
-        * @see tslib_gifBuilder::make()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make()
         * @todo Define visibility
         */
        public function maskImageOntoImage(&$im, $conf, $workArea) {
@@ -463,7 +463,7 @@ class GraphicalFunctions {
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @param array $workArea The current working area coordinates.
         * @return void
-        * @see tslib_gifBuilder::make(), maskImageOntoImage()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make(), maskImageOntoImage()
         * @todo Define visibility
         */
        public function copyImageOntoImage(&$im, $conf, $workArea) {
@@ -597,7 +597,7 @@ class GraphicalFunctions {
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @param array $workArea The current working area coordinates.
         * @return void
-        * @see tslib_gifBuilder::make()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make()
         * @todo Define visibility
         */
        public function makeText(&$im, $conf, $workArea) {
@@ -708,7 +708,7 @@ class GraphicalFunctions {
         *
         * @param array $conf TypoScript array for the TEXT GIFBUILDER object
         * @param array $workArea Workarea definition
-        * @param array $BB Bounding box information, was set in tslib_gifBuilder::start()
+        * @param array $BB Bounding box information, was set in \TYPO3\CMS\Frontend\Imaging\GifBuilder::start()
         * @return array [0]=x, [1]=y, [2]=w, [3]=h
         * @access private
         * @see makeText()
@@ -765,7 +765,7 @@ class GraphicalFunctions {
         * @param array $conf TypoScript array for the TEXT GIFBUILDER object
         * @return array Array with three keys [0]/[1] being x/y and [2] being the bounding box array
         * @access private
-        * @see txtPosition(), tslib_gifBuilder::start()
+        * @see txtPosition(), \TYPO3\CMS\Frontend\Imaging\GifBuilder::start()
         * @todo Define visibility
         */
        public function calcBBox($conf) {
@@ -927,7 +927,7 @@ class GraphicalFunctions {
         * @param array $conf The TypoScript properties of the TEXT GIFBUILDER object
         * @return integer The new fontSize
         * @access private
-        * @see tslib_gifBuilder::start()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::start()
         * @todo Define visibility
         */
        public function fontResize($conf) {
@@ -1350,7 +1350,7 @@ class GraphicalFunctions {
         * @param array $workArea The current working area coordinates.
         * @param array $txtConf TypoScript array with configuration for the associated TEXT GIFBUILDER object.
         * @return void
-        * @see tslib_gifBuilder::make(), makeText()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make(), makeText()
         * @todo Define visibility
         */
        public function makeOutline(&$im, $conf, $workArea, $txtConf) {
@@ -1409,7 +1409,7 @@ class GraphicalFunctions {
         * @param array $workArea The current working area coordinates.
         * @param array $txtConf TypoScript array with configuration for the associated TEXT GIFBUILDER object.
         * @return void
-        * @see tslib_gifBuilder::make(), makeShadow()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make(), makeShadow()
         * @todo Define visibility
         */
        public function makeEmboss(&$im, $conf, $workArea, $txtConf) {
@@ -1432,7 +1432,7 @@ class GraphicalFunctions {
         * @param array $workArea The current working area coordinates.
         * @param array $txtConf TypoScript array with configuration for the associated TEXT GIFBUILDER object.
         * @retur void
-        * @see tslib_gifBuilder::make(), makeText(), makeEmboss()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make(), makeText(), makeEmboss()
         * @todo Define visibility
         */
        public function makeShadow(&$im, $conf, $workArea, $txtConf) {
@@ -1548,7 +1548,7 @@ class GraphicalFunctions {
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @param array $workArea The current working area coordinates.
         * @return void
-        * @see tslib_gifBuilder::make()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make()
         * @todo Define visibility
         */
        public function makeBox(&$im, $conf, $workArea) {
@@ -1588,7 +1588,7 @@ class GraphicalFunctions {
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @param array $workArea The current working area coordinates.
         * @return void
-        * @see tslib_gifBuilder::make()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make()
         */
        public function makeEllipse(&$im, array $conf, array $workArea) {
                $ellipseConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::intExplode(',', $conf['dimensions'] . ',,,');
@@ -1608,7 +1608,7 @@ class GraphicalFunctions {
         * @param pointer $im GDlib image pointer
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @return void
-        * @see tslib_gifBuilder::make(), applyImageMagickToPHPGif()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make(), applyImageMagickToPHPGif()
         * @todo Define visibility
         */
        public function makeEffect(&$im, $conf) {
@@ -1710,7 +1710,7 @@ class GraphicalFunctions {
         * @param pointer $im GDlib image pointer
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @return void
-        * @see tslib_gifBuilder::make(), autoLevels(), outputLevels(), inputLevels()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make(), autoLevels(), outputLevels(), inputLevels()
         * @todo Define visibility
         */
        public function adjust(&$im, $conf) {
@@ -1746,7 +1746,7 @@ class GraphicalFunctions {
         * @param pointer $im GDlib image pointer
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @return void
-        * @see tslib_gifBuilder::make()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make()
         * @todo Define visibility
         */
        public function crop(&$im, $conf) {
@@ -1785,7 +1785,7 @@ class GraphicalFunctions {
         * @param pointer $im GDlib image pointer
         * @param array $conf TypoScript array with configuration for the GIFBUILDER object.
         * @return void
-        * @see tslib_gifBuilder::make()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make()
         * @todo Define visibility
         */
        public function scale(&$im, $conf) {
@@ -1819,7 +1819,7 @@ class GraphicalFunctions {
         * @param string $workArea Working area dimensions, comma separated
         * @return void
         * @access private
-        * @see tslib_gifBuilder::make()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::make()
         * @todo Define visibility
         */
        public function setWorkArea($workArea) {
@@ -2773,7 +2773,7 @@ class GraphicalFunctions {
         *
         * @param string $file The filename to write to.
         * @return string Returns input filename
-        * @see tslib_gifBuilder::gifBuild()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::gifBuild()
         * @todo Define visibility
         */
        public function output($file) {
@@ -2821,7 +2821,7 @@ class GraphicalFunctions {
         * Destroy internal image pointer, $this->im
         *
         * @return void
-        * @see tslib_gifBuilder::gifBuild()
+        * @see \TYPO3\CMS\Frontend\Imaging\GifBuilder::gifBuild()
         * @todo Define visibility
         */
        public function destroy() {
index 60c57da..242b347 100644 (file)
@@ -241,8 +241,8 @@ class FileProcessingService {
                // checks to see if m (the mask array) is defined
                $doMasking = is_array($configuration['maskImages']) && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im'];
                // @todo: is it ok that we use tslib (=FE) here?
-               /** @var $gifBuilder tslib_gifbuilder */
-               $gifBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_gifbuilder');
+               /** @var $gifBuilder \TYPO3\CMS\Frontend\Imaging\GifBuilder */
+               $gifBuilder = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
                $gifBuilder->init();
                // @todo: this is not clean yet
                if (!trim($configuration['fileExtension'])) {
index b22fa7d..e86dc3e 100644 (file)
@@ -83,8 +83,8 @@ class ImageProcessingService {
                if (isset($GLOBALS['TSFE']->tmpl->fileCache[$hash])) {
                        return $GLOBALS['TSFE']->tmpl->fileCache[$hash];
                }
-               /** @var $gifCreator tslib_gifbuilder */
-               $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_gifbuilder');
+               /** @var $gifCreator \TYPO3\CMS\Frontend\Imaging\GifBuilder */
+               $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
                $gifCreator->init();
                if ($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']) {
                        $filename = basename($theImage);
@@ -161,7 +161,7 @@ class ImageProcessingService {
                        $GLOBALS['TSFE']->tmpl->fileCache[$hash] = $gifCreator->getImageDimensions($fileDestination);
                }
                $GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile'] = $theImage;
-               // This is needed by tslib_gifbuilder, in order for the setup-array to create a unique filename hash.
+               // This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, in order for the setup-array to create a unique filename hash.
                $GLOBALS['TSFE']->tmpl->fileCache[$hash]['origFile_mtime'] = @filemtime($theImage);
                $GLOBALS['TSFE']->tmpl->fileCache[$hash]['fileCacheHash'] = $hash;
                if ($file instanceof \TYPO3\CMS\Core\Resource\FileInterface && \TYPO3\CMS\Core\Utility\GeneralUtility::isAbsPath($GLOBALS['TSFE']->tmpl->fileCache[$hash][3])) {
index 12144a9..b4ffcd2 100644 (file)
@@ -1295,7 +1295,7 @@ class TemplateService {
         * @param array $setupArr TypoScript array with numerical array in
         * @param boolean $acceptOnlyProperties If set, then a value is not required - the properties alone will be enough.
         * @return array An array with all integer properties listed in numeric order.
-        * @see tslib_cObj::cObjGet(), tslib_gifBuilder, tslib_imgmenu::makeImageMap()
+        * @see tslib_cObj::cObjGet(), \TYPO3\CMS\Frontend\Imaging\GifBuilder, tslib_imgmenu::makeImageMap()
         */
        static public function sortedKeyList($setupArr, $acceptOnlyProperties = FALSE) {
                $keyArr = array();
index 8211ede..86f8975 100644 (file)
@@ -964,7 +964,7 @@ class GeneralUtility {
         * @param string $string Input string, eg "123 + 456 / 789 - 4
         * @param string $operators Operators to split by, typically "/+-*
         * @return array Array with operators and operands separated.
-        * @see tslib_cObj::calc(), tslib_gifBuilder::calcOffset()
+        * @see tslib_cObj::calc(), \TYPO3\CMS\Frontend\Imaging\GifBuilder::calcOffset()
         */
        static public function splitCalc($string, $operators) {
                $res = array();
index 44d2bfb..0c828d3 100644 (file)
@@ -578,7 +578,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                $equalHeight = intval($this->cObj->stdWrap($conf['equalH'], $conf['equalH.']));
                if ($equalHeight) {
                        // Initiate gifbuilder object in order to get dimensions AND calculate the imageWidth's
-                       $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_gifbuilder');
+                       $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
                        $gifCreator->init();
                        $relations_cols = array();
                        // contains the individual width of all images after scaling to $equalHeight
index 1574a2c..c16b81e 100644 (file)
@@ -1426,7 +1426,7 @@ class ContentObjectRenderer {
                                                        $url = $altUrl . ($conf['JSwindow.']['altUrl_noDefaultParams'] ? '' : '?file=' . rawurlencode($imageFile) . $params);
                                                }
                                        }
-                                       $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_gifbuilder');
+                                       $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
                                        $gifCreator->init();
                                        $gifCreator->mayScaleUp = 0;
                                        $dims = $gifCreator->getImageScale($gifCreator->getImageDimensions($imageFile), $conf['width'], $conf['height'], array());
@@ -5005,14 +5005,14 @@ class ContentObjectRenderer {
         * @param string $file A "imgResource" TypoScript data type. Either a TypoScript file resource or the string GIFBUILDER. See description above.
         * @param array $fileArray TypoScript properties for the imgResource type
         * @return array Returns info-array. info[origFile] = original file. [0]/[1] is w/h, [2] is file extension and [3] is the filename.
-        * @see IMG_RESOURCE(), cImage(), tslib_gifBuilder
+        * @see IMG_RESOURCE(), cImage(), \TYPO3\CMS\Frontend\Imaging\GifBuilder
         * @todo Define visibility
         */
        public function getImgResource($file, $fileArray) {
                if (is_array($fileArray)) {
                        switch ($file) {
                        case 'GIFBUILDER':
-                               $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_gifbuilder');
+                               $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
                                $gifCreator->init();
                                $theImage = '';
                                if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']) {
@@ -5082,7 +5082,8 @@ class ContentObjectRenderer {
                                                                3 => $processedFileObject->getPublicUrl(),
                                                                'origFile' => $fileObject->getPublicUrl(),
                                                                'origFile_mtime' => $fileObject->getModificationTime(),
-                                                               // This is needed by tslib_gifbuilder, ln 100ff in order for the setup-array to create a unique filename hash.
+                                                               // This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, line 100ff
+                                                               // in order for the setup-array to create a unique filename hash.
                                                                'originalFile' => $fileObject,
                                                                'processedFile' => $processedFileObject,
                                                                'fileCacheHash' => $hash
@@ -5100,12 +5101,12 @@ class ContentObjectRenderer {
                // If image was processed by GIFBUILDER:
                // ($imageResource indicates that it was processed the regular way)
                if (!isset($imageResource) && $theImage) {
-                       $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_gifbuilder');
-                       /** @var $gifCreator tslib_gifbuilder */
+                       $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
+                       /** @var $gifCreator \TYPO3\CMS\Frontend\Imaging\GifBuilder */
                        $gifCreator->init();
                        $info = $gifCreator->imageMagickConvert($theImage, 'WEB');
                        $info['origFile'] = $theImage;
-                       // This is needed by tslib_gifbuilder, ln 100ff in order for the setup-array to create a unique filename hash.
+                       // This is needed by \TYPO3\CMS\Frontend\Imaging\GifBuilder, ln 100ff in order for the setup-array to create a unique filename hash.
                        $info['origFile_mtime'] = @filemtime($theImage);
                        $imageResource = $info;
                }
index 8ee9553..57eb45a 100644 (file)
@@ -168,7 +168,7 @@ class ImageTextContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractC
                        $equalHeight = isset($conf['equalH.']) ? intval($this->cObj->stdWrap($conf['equalH'], $conf['equalH.'])) : intval($conf['equalH']);
                        // Initiate gifbuilder object in order to get dimensions AND calculate the imageWidth's
                        if ($equalHeight) {
-                               $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_gifbuilder');
+                               $gifCreator = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
                                $gifCreator->init();
                                $relations = array();
                                $relations_cols = array();
index 447f661..fdab56c 100644 (file)
@@ -43,7 +43,7 @@ namespace TYPO3\CMS\Frontend\Imaging;
  *
  * Here is an example of how to use this class (from tslib_content.php, function getImgResource):
  *
- * $gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
+ * $gifCreator = t3lib_div::makeInstance('TYPO3\\CMS\\Frontend\\Imaging\\GifBuilder');
  * $gifCreator->init();
  * $theImage='';
  * if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib']) {