Project

General

Profile

Actions

Bug #22514

closed

imageMagickCommand parameters incorrectly swapped

Added by Peter Murray over 14 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2010-04-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

In the class.t3lib_div.php function imageMagickCommand($command, $parameters, $path='') the section below is incorrect if $TYPO3_CONF_VARS['GFX']['im_useStripProfileByDefault'] = '1'

if($command=='composite' && $switchCompositeParameters) { // Because of some weird incompatibilities between ImageMagick 4 and 6 (plus GraphicsMagick), it is needed to change the parameters order under some preconditions
$paramsArr = self::unQuoteFilenames($parameters);

if(count($paramsArr)>5) {       // The mask image has been specified => swap the parameters
$tmp = $paramsArr[count($paramsArr)-3];
$paramsArr[count($paramsArr)-3] = $paramsArr[count($paramsArr)-4];
$paramsArr[count($paramsArr)-4] = $tmp;
}
$cmdLine = $path.' '.implode(' ', $paramsArr);
}

The Strip Profile parameters are included in the count of parameters and so this is an incorrect method for testing if a mask image has been specified and it swaps the wrong parameters.

This was discovered when using the rounded_corners extension. The commands generated are constructed with $cmd = t3lib_div::imageMagickCommand('composite', '-gravity NorthEast '.$cornerNE .' '.$info3.' '.$newfile);

With $TYPO3_CONF_VARS['GFX']['im_useStripProfileByDefault'] = '1' set, the NorthEast parameter is swapped with the $cornerNE value, causing an error: gm composite: Unrecognized gravity type

localconf.php Image settings:
$TYPO3_CONF_VARS['GFX']['gdlib_png'] = '0';
$TYPO3_CONF_VARS['GFX']['im_combine_filename'] = 'composite';
$TYPO3_CONF_VARS['GFX']['im_path'] = '/usr/local/bin/';
$TYPO3_CONF_VARS['GFX']['im_path_lzw'] = '/usr/local/bin/';
$TYPO3_CONF_VARS['GFX']['im_version_5'] = 'gm';
$TYPO3_CONF_VARS['GFX']['im_imvMaskState'] = '1';
$TYPO3_CONF_VARS['GFX']['TTFdpi'] = '96';
$TYPO3_CONF_VARS['GFX']['im_useStripProfileByDefault'] = '1';

Setting $TYPO3_CONF_VARS['GFX']['im_useStripProfileByDefault'] = '0'; enables the rounded_corners extension to work correctly.
(issue imported from #M14204)


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #22605: t3lib_div::imageMagickCommand incorrectly change parameters orderClosed2010-05-07

Actions
Actions

Also available in: Atom PDF