From 250ff31741204eb1b3111bb6bbc4c4348a60cea1 Mon Sep 17 00:00:00 2001 From: Paul Golmann <mail@pje-web.de> Date: Thu, 9 Mar 2017 12:12:50 +0100 Subject: [PATCH] [BUGFIX] Fix imagemagick commands when setting stripProfile to "0" Remove the ###SkipStripProfile### flag from command parameters added by e.g. stripProfile in TypoScript if GFX[processor_stripColorProfileByDefault] is disabled in global configuration to prevent erroneous imagemagick commands. Resolves: #80208 Releases: master, 8.7 Change-Id: I0860744ad4b27e44f1d9f7bb6da5dd646f4a1fc4 Reviewed-on: https://review.typo3.org/51990 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com> Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> --- .../sysext/core/Classes/Utility/CommandUtility.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/typo3/sysext/core/Classes/Utility/CommandUtility.php b/typo3/sysext/core/Classes/Utility/CommandUtility.php index c1bc90c6eb2c..a1a894cd6435 100644 --- a/typo3/sysext/core/Classes/Utility/CommandUtility.php +++ b/typo3/sysext/core/Classes/Utility/CommandUtility.php @@ -110,13 +110,14 @@ class CommandUtility $path = self::escapeShellArgument($path . $command . $isExt); } // strip profile information for thumbnails and reduce their size - if ($parameters && $command !== 'identify' - && $gfxConf['processor_stripColorProfileByDefault'] - && $gfxConf['processor_stripColorProfileCommand'] !== '' - && strpos($parameters, $gfxConf['processor_stripColorProfileCommand']) === false - ) { + if ($parameters && $command !== 'identify') { // Determine whether the strip profile action has be disabled by TypoScript: - if ($parameters !== '-version' && strpos($parameters, '###SkipStripProfile###') === false) { + if ($gfxConf['processor_stripColorProfileByDefault'] + && $gfxConf['processor_stripColorProfileCommand'] !== '' + && strpos($parameters, $gfxConf['processor_stripColorProfileCommand']) === false + && $parameters !== '-version' + && strpos($parameters, '###SkipStripProfile###') === false + ) { $parameters = $gfxConf['processor_stripColorProfileCommand'] . ' ' . $parameters; } else { $parameters = str_replace('###SkipStripProfile###', '', $parameters); -- GitLab