Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (Revision 9323) +++ t3lib/class.t3lib_div.php (Arbeitskopie) @@ -5947,7 +5947,7 @@ * * @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='') { @@ -5956,6 +5956,7 @@ $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'; @@ -5967,10 +5968,10 @@ // 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 Index: typo3/sysext/install/mod/class.tx_install.php =================================================================== --- typo3/sysext/install/mod/class.tx_install.php (Revision 9323) +++ typo3/sysext/install/mod/class.tx_install.php (Arbeitskopie) @@ -1274,9 +1274,17 @@ 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\\'); + if (!isset($_SERVER['PATH'])) { + $serverPath = array_change_key_case($_SERVER, CASE_UPPER); + $paths = array_merge($paths, explode(';', $serverPath['PATH'])); + } else { + $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/'); + $paths = array_merge($paths, explode(':', $_SERVER['PATH'])); } + $paths = array_unique($paths); asort($paths); if (t3lib_utility_PhpOptions::isSafeModeEnabled()) { @@ -3801,43 +3809,30 @@ 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); - if (!preg_match('/[[:space:]]/',$value) && strlen($value)<100) { - if (strcmp($GLOBALS['TYPO3_CONF_VARS']['GFX'][$key], $value)) { - $this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'GFX\'][\'' . $key . '\']', $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); } break; case 'TTFdpi':