[BUGFIX] TypoScript stripProfile not forwarded to ProcessedFile 57/19957/2
authorOliver Hader <oliver@typo3.org>
Thu, 11 Apr 2013 22:02:49 +0000 (00:02 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 14 Apr 2013 07:53:21 +0000 (09:53 +0200)
The TypoScript stripProfile feature not forwarded to
ProcessedFile anymore. Example of the feature that has
been available in TYPO3 CMS 4.x:

10 = IMAGE
10.file = fileadmin/images/image1.jpg
10.file.stripProfile = 1

The protected method modifyImageMagickStripProfileParameters()
does not make any sense anymore since the actual ImageMagick
processing has been moved around in TYPO3 CMS 6.0.

Fixes: #47145
Releases: 6.0, 6.1
Change-Id: If9a36def32327d3fc610b5f4ebc998bee2babf49
Reviewed-on: https://review.typo3.org/19814
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-on: https://review.typo3.org/19957
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 77b1a55..d1bdc27 100644 (file)
@@ -5100,6 +5100,11 @@ class ContentObjectRenderer {
                                        $processingConfiguration['minHeight'] = isset($fileArray['minH.']) ? intval($this->stdWrap($fileArray['minH'], $fileArray['minH.'])) : intval($fileArray['minH']);
                                        $processingConfiguration['noScale'] = isset($fileArray['noScale.']) ? $this->stdWrap($fileArray['noScale'], $fileArray['noScale.']) : $fileArray['noScale'];
                                        $processingConfiguration['additionalParameters'] = isset($fileArray['params.']) ? $this->stdWrap($fileArray['params'], $fileArray['params.']) : $fileArray['params'];
+                                       // Possibility to cancel/force profile extraction
+                                       // see $TYPO3_CONF_VARS['GFX']['im_stripProfileCommand']
+                                       if (isset($fileArray['stripProfile'])) {
+                                               $processingConfiguration['stripProfile'] = $fileArray['stripProfile'];
+                                       }
                                        // Check if we can handle this type of file for editing
                                        if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileObject->getExtension())) {
                                                $maskArray = $fileArray['m.'];
@@ -5161,25 +5166,6 @@ class ContentObjectRenderer {
                return $imageResource;
        }
 
-       /**
-        * Modifies the parameters for ImageMagick for stripping of profile information.
-        *
-        * @param string $parameters The parameters to be modified (if required)
-        * @param array $configuration The TypoScript configuration of [IMAGE].file
-        * @return string The modified parameters
-        */
-       protected function modifyImageMagickStripProfileParameters($parameters, array $configuration) {
-               // Strips profile information of image to save some space:
-               if (isset($configuration['stripProfile'])) {
-                       if ($configuration['stripProfile']) {
-                               $parameters = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_stripProfileCommand'] . $parameters;
-                       } else {
-                               $parameters .= '###SkipStripProfile###';
-                       }
-               }
-               return $parameters;
-       }
-
        /***********************************************
         *
         * Data retrieval etc.