From 7e04899ed9261361529a31d5c6632575dfbe2b96 Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Fri, 21 Jun 2013 22:57:40 +0200
Subject: [PATCH] [TASK] Remove last bits of gdlib_2 setting

Support for gdlib version 1 was removed with core version 4.4.
The patch removes the last code fragments where the old GFX/gdlib_2
setting was used and activates a key in ext:install to remove
the setting from LocalConfiguration.

Change-Id: Icec65f13468306b80a575996a23cdbbbd21d715c
Resolves: #49335
Related: #22687
Related: #49299
Releases: 6.2
Reviewed-on: https://review.typo3.org/21582
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Markus Klein
Reviewed-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Tested-by: Markus Klein
---
 .../Classes/Imaging/GraphicalFunctions.php    | 23 +++----------------
 .../Classes/Controller/StepController.php     |  6 ++---
 2 files changed, 6 insertions(+), 23 deletions(-)

diff --git a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
index 039820b5c099..eb576a1cc7e2 100644
--- a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
+++ b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
@@ -26,22 +26,14 @@ namespace TYPO3\CMS\Core\Imaging;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+
 /**
  * Standard graphical functions
  *
- * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
-/**
- * Class contains a bunch of cool functions for manipulating graphics with GDlib/Freetype and ImageMagick
+ * 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
  *
- * With TYPO3 4.4 GDlib 1.x support was dropped, also an option from $TYPO3_CONF_VARS
- * $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 \TYPO3\CMS\Frontend\Imaging\GifBuilder
  */
 class GraphicalFunctions {
 
@@ -58,12 +50,6 @@ class GraphicalFunctions {
 	 */
 	public $noFramePrepended = 0;
 
-	// If set, imagecopyresized will not be called directly. For GD2 (some PHP installs?)
-	/**
-	 * @todo Define visibility
-	 */
-	public $imagecopyresized_fix = 0;
-
 	// This should be changed to 'png' if you want this class to read/make PNG-files instead!
 	/**
 	 * @todo Define visibility
@@ -359,9 +345,6 @@ class GraphicalFunctions {
 		if ($gfxConf['im_noFramePrepended']) {
 			$this->noFramePrepended = 1;
 		}
-		// Kept for backwards compatibility, can be turned on manually through localconf.php,
-		// but not through the installer anymore
-		$this->imagecopyresized_fix = $gfxConf['gdlib_2'] === 'no_imagecopyresized_fix' ? 0 : 1;
 		if ($gfxConf['gdlib_png']) {
 			$this->gifExtension = 'png';
 		}
@@ -617,7 +600,7 @@ class GraphicalFunctions {
 	 * @todo Define visibility
 	 */
 	public function imagecopyresized(&$dstImg, $srcImg, $dstX, $dstY, $srcX, $srcY, $dstWidth, $dstHeight, $srcWidth, $srcHeight) {
-		if ($this->imagecopyresized_fix && !$this->saveAlphaLayer) {
+		if (!$this->saveAlphaLayer) {
 			// Make true color image
 			$tmpImg = imagecreatetruecolor(imagesx($dstImg), imagesy($dstImg));
 			// Copy the source image onto that
diff --git a/typo3/sysext/install/Classes/Controller/StepController.php b/typo3/sysext/install/Classes/Controller/StepController.php
index 971a4577dcd8..dbcffc785ecc 100644
--- a/typo3/sysext/install/Classes/Controller/StepController.php
+++ b/typo3/sysext/install/Classes/Controller/StepController.php
@@ -68,8 +68,8 @@ class StepController extends AbstractController {
 		'FE/defaultTypoScript_editorcfg.',
 		// #25099
 		'FE/simulateStaticDocuments',
-		// @TODO: #14441 - Still referenced at one place
-		//'GFX/gdlib_2',
+		// #22687
+		'GFX/gdlib_2',
 		// # ?
 		'GFX/noIconProc',
 		// #17606
@@ -380,4 +380,4 @@ class StepController extends AbstractController {
 		}
 	}
 }
-?>
\ No newline at end of file
+?>
-- 
GitLab