Bug #17489 » 6001-trunk.patch
t3lib/class.t3lib_div.php (working copy) | ||
---|---|---|
*
|
||
* @param string Command to be run: identify, convert or combine/composite
|
||
* @param string The parameters string
|
||
* @param string Override the default path
|
||
* @param string Override the default path (e.g. used by the install tool)
|
||
* @return string Compiled command that deals with IM6 & GraphicsMagick
|
||
*/
|
||
public static function imageMagickCommand($command, $parameters, $path='') {
|
||
... | ... | |
$switchCompositeParameters=false;
|
||
if(!$path) { $path = $gfxConf['im_path']; }
|
||
$path = self::fixWindowsFilePath($path);
|
||
$im_version = strtolower($gfxConf['im_version_5']);
|
||
$combineScript = $gfxConf['im_combine_filename'] ? trim($gfxConf['im_combine_filename']) : 'combine';
|
||
... | ... | |
// Compile the path & command
|
||
if($im_version==='gm') {
|
||
$switchCompositeParameters=true;
|
||
$path .= 'gm'.$isExt.' '.$command;
|
||
$path = escapeshellarg($path . 'gm' . $isExt) . ' ' . $command;
|
||
} else {
|
||
if($im_version==='im6') { $switchCompositeParameters=true; }
|
||
$path .= (($command=='composite') ? $combineScript : $command).$isExt;
|
||
$path = escapeshellarg($path . (($command == 'composite') ? $combineScript : $command) . $isExt);
|
||
}
|
||
// strip profile information for thumbnails and reduce their size
|
typo3/sysext/install/mod/class.tx_install.php (working copy) | ||
---|---|---|
if (TYPO3_OS=='WIN') {
|
||
$paths=array($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'], $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'], 'c:\\php\\imagemagick\\', 'c:\\php\\GraphicsMagick\\', 'c:\\apache\\ImageMagick\\', 'c:\\apache\\GraphicsMagick\\');
|
||
$paths = array_merge($paths, explode(';', $_SERVER['PATH']));
|
||
} else {
|
||
$paths=array($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'], $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'], '/usr/local/bin/','/usr/bin/','/usr/X11R6/bin/');
|
||
}
|
||
... | ... | |
break;
|
||
case 'im_path':
|
||
list($value,$version) = explode('|',$value);
|
||
if (!preg_match('/[[:space:]]/',$value,$reg) && strlen($value)<100) {
|
||
if (strcmp($GLOBALS['TYPO3_CONF_VARS']['GFX'][$key], $value)) {
|
||
$this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'GFX\'][\'' . $key . '\']', $value);
|
||
}
|
||
if(doubleval($version)>0 && doubleval($version)<4) { // Assume GraphicsMagick
|
||
$value_ext = 'gm';
|
||
} elseif(doubleval($version)<5) { // Assume ImageMagick 4.x
|
||
$value_ext = '';
|
||
} elseif(doubleval($version) >= 6) { // Assume ImageMagick 6.x
|
||
$value_ext = 'im6';
|
||
} else { // Assume ImageMagick 5.x
|
||
$value_ext = 'im5';
|
||
}
|
||
if (strcmp(strtolower($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5']),$value_ext)) {
|
||
$this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'GFX\'][\'im_version_5\']', $value_ext);
|
||
}
|
||
// if (strcmp(strtolower($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5']),$value)) $this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS['GFX']['im_version_5']', $value);
|
||
} else {
|
||
$this->errorMessages[] = '
|
||
Path \'' . $value . '\' contains spaces
|
||
or is longer than 100 chars (...not
|
||
saved)
|
||
';
|
||
if (strcmp($GLOBALS['TYPO3_CONF_VARS']['GFX'][$key], $value)) {
|
||
$this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'GFX\'][\'' . $key . '\']', $value);
|
||
}
|
||
if(doubleval($version)>0 && doubleval($version)<4) { // Assume GraphicsMagick
|
||
$value_ext = 'gm';
|
||
} elseif(doubleval($version)<5) { // Assume ImageMagick 4.x
|
||
$value_ext = '';
|
||
} elseif(doubleval($version) >= 6) { // Assume ImageMagick 6.x
|
||
$value_ext = 'im6';
|
||
} else { // Assume ImageMagick 5.x
|
||
$value_ext = 'im5';
|
||
}
|
||
if (strcmp(strtolower($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_version_5']),$value_ext)) {
|
||
$this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'GFX\'][\'im_version_5\']', $value_ext);
|
||
}
|
||
break;
|
||
case 'im_path_lzw':
|
||
list($value) = explode('|',$value);
|