Bug #80208
closedImageMagick commands fail if stripProfile is set to 0 and GFX[processor_stripColorProfileByDefault] is disabled
100%
Description
Problem¶
When disabling [GFX][processor_stripColorProfileByDefault]
in the global configuration and setting stripProfile = 0
for an imgResource in TypoScript or when using the "keep metadata" option in the extension image_autoresize the image does not get processed.
Reproduction¶
Tested on fresh installations of TYPO3 v6.2.30 with ImageMagick 6.8.7-0 2014-11-14
and TYPO3 v8.6.0 with ImageMagick 6.8.9-9 Q16 x86_64
.
setup¶
1. Set [GFX][processor_stripColorProfileByDefault] = 0 (or [GFX][im_useStripProfileByDefault] = 0 for TYPO3 v6) in Installtool or Localconfiguration.php
2. Upload a test JPEG image to fileadmin
(greater than 100x100 px called test.jpg
)
2. Create a new page, add a sys_template
, add the following setup:
page = PAGE page { 10 = IMAGE 10 { file = fileadmin/test.jpg file { width = 100c height = 100c stripProfile = 0 } } }
3. View the page
expected output¶
The test image cropped to 100x100 pixels.
actual result¶
The unprocessed test image.
Further information¶
I tracked the call stack to the CommandUtility
in which the marker ###SkipStripProfile###
introduced by the ContentObject ends up. In the case that stripping the profile by default is disabled in the global configuration the actual command is something like (depending on the other GFX settings and acutal size of test image):
'/usr/bin/convert' -geometry 100x140! ###SkipStripProfile### -crop 100x100+0+20! '/var/www/html/fileadmin/test.jpg[0]' '/var/www/html/typo3temp/pics/01a24339bf.jpg', which produces the following error for me, when testing it directly on the command line:
convert: missing an image filename `100x140!' @ error/convert.c/ConvertImageCommand/3207.
. But should be something like the following, not having the marker in it:
'/usr/bin/convert' -geometry 100x140! -crop 100x100+0+20! '/var/www/html/fileadmin/test.jpg[0]' '/var/www/html/typo3temp/pics/01a24339bf.jpg'
Updated by Paul Golmann over 7 years ago
I've committed a patch for master (https://review.typo3.org/#/c/51990/), but the solution for 6.2 should be quite similar, if this should be backported:
// strip profile information for thumbnails and reduce their size if ($parameters && $command != 'identify') { // Determine whether the strip profile action has be disabled by TypoScript: if ($gfxConf['im_useStripProfileByDefault'] && $gfxConf['im_stripProfileCommand'] != '' && strpos($parameters, $gfxConf['im_stripProfileCommand']) === FALSE && $parameters !== '-version' && strpos($parameters, '###SkipStripProfile###') === FALSE ) { $parameters = $gfxConf['im_stripProfileCommand'] . ' ' . $parameters; } else { $parameters = str_replace('###SkipStripProfile###', '', $parameters); } }
Updated by Benni Mack over 7 years ago
- Target version changed from 8 LTS to next-patchlevel
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51990
Updated by Gerrit Code Review over 7 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51990
Updated by Susanne Moog about 7 years ago
- Category changed from Image Cropping to Image Generation / GIFBUILDER
Updated by Gerrit Code Review over 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51990
Updated by Gerrit Code Review over 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55979
Updated by Paul Golmann over 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 250ff31741204eb1b3111bb6bbc4c4348a60cea1.