[BUGFIX] Fix imagemagick commands when setting stripProfile to "0" 90/51990/5
authorPaul Golmann <mail@pje-web.de>
Thu, 9 Mar 2017 11:12:50 +0000 (12:12 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 1 Mar 2018 22:19:39 +0000 (23:19 +0100)
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>
typo3/sysext/core/Classes/Utility/CommandUtility.php

index c1bc90c..a1a894c 100644 (file)
@@ -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);