From 987a9eafb30e352959225032264bc7875d2dfc19 Mon Sep 17 00:00:00 2001 From: Stefan Neufeind Date: Mon, 28 Nov 2016 11:33:30 +0100 Subject: [PATCH] [BUGFIX] Re-apply colorspace to resulting image When using filters the colorspace is not always applied. A quickfix is to add the colorspace-setting again before writing the output-image. Multiple colorspace-settings on the commandline will be executed in order. For example the grayscale-filter uses "-colorspace GRAY". The final output-image can then be converted to "-colorspace sRGB" again so the brightness appears correct (not too dark) again. Resolves: #78816 Releases: master, 8.7 Change-Id: I3fcabf8fdbb8d43f15662532b881501ebb43b1dd Reviewed-on: https://review.typo3.org/50791 Reviewed-by: Mathias Schreiber Tested-by: Mathias Schreiber Tested-by: TYPO3com Reviewed-by: Christian Kuhn Tested-by: Christian Kuhn --- typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php index a756cca68f95..9006f6eae119 100644 --- a/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php +++ b/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php @@ -2121,6 +2121,8 @@ public function imageMagickConvert($imagefile, $newExt = '', $w = '', $h = '', $ $params .= ' -crop ' . $data['origW'] . 'x' . $data['origH'] . '+' . $offsetX . '+' . $offsetY . '! '; } $command = $this->scalecmd . ' ' . $info[0] . 'x' . $info[1] . '! ' . $params . ' '; + // re-apply colorspace-setting for the resulting image so colors don't appear to dark (sRGB instead of RGB) + $command .= ' -colorspace ' . $this->colorspace; $cropscale = $data['crs'] ? 'crs-V' . $data['cropV'] . 'H' . $data['cropH'] : ''; if ($this->alternativeOutputKey) { $theOutputName = GeneralUtility::shortMD5($command . $cropscale . basename($imagefile) . $this->alternativeOutputKey . '[' . $frame . ']');