Feature #14703 » 01_replaceExec.diff
typo3_src-3.8.0beta2.1/t3lib/class.t3lib_div.php 2005-04-25 02:20:33.000000000 +0200 | ||
---|---|---|
$gfxConf = $GLOBALS['TYPO3_CONF_VARS']['GFX'];
|
||
$returnCode='';
|
||
if ($gfxConf['gif_compress'] && strtolower(substr($theFile,-4,4))=='.gif') { // GIF...
|
||
if (($type=='IM' || !$type) && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im'] && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw']) { // IM
|
||
exec($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'].'convert "'.$theFile.'" "'.$theFile.'"');
|
||
if (($type=='IM' || !$type) && $gfxConf['im'] && $gfxConf['im_path_lzw']) { // IM
|
||
$cmd = t3lib_div::imageMagickCommand('convert', '"'.$theFile.'" "'.$theFile.'"', $gfxConf['im_path_lzw']);
|
||
exec($cmd);
|
||
$returnCode='IM';
|
||
} elseif (($type=='GD' || !$type) && $gfxConf['gdlib'] && !$gfxConf['gdlib_png']) { // GD
|
||
$tempImage = imageCreateFromGif($theFile);
|
||
... | ... | |
&& strtolower(substr($theFile,-4,4))=='.png'
|
||
&& @is_file($theFile)) { // IM
|
||
$newFile = substr($theFile,0,-4).'.gif';
|
||
exec($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'].'convert "'.$theFile.'" "'.$newFile.'"');
|
||
$cmd = t3lib_div::imageMagickCommand('convert', '"'.$theFile.'" "'.$newFile.'"', $gfxConf['im_path_lzw']);
|
||
exec($cmd);
|
||
$theFile = $newFile;
|
||
// unlink old file?? May be bad idea bacause TYPO3 would then recreate the file every time as TYPO3 thinks the file is not generated because it's missing!! So do not unlink $theFile here!!
|
||
}
|
typo3_src-3.8.0beta2.1/t3lib/class.t3lib_iconworks.php 2005-04-25 02:34:33.000000000 +0200 | ||
---|---|---|
function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h) {
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_2'] && $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png']) { // Maybe I'll have to change this if GD2/gif does not work either...
|
||
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path']) {
|
||
$cmd=$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'].
|
||
($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_combine_filename']?$GLOBALS['TYPO3_CONF_VARS']['GFX']['im_combine_filename']:'combine').
|
||
' -compose over ';
|
||
$tempBaseName = PATH_site.'typo3temp/ICRZ_'.md5(uniqid('.'));
|
||
ImagePng($im, $tempBaseName.'_im.png');
|
||
ImagePng($cpImg, $tempBaseName.'_cpImg.png');
|
||
exec($cmd.
|
||
$tempBaseName.'_cpImg.png '.
|
||
$tempBaseName.'_im.png '.
|
||
$tempBaseName.'_out.png '
|
||
);
|
||
$cmd = t3lib_exec::imageMagickCommand('combine', '-compose over '.$tempBaseName.'_cpImg.png '.$tempBaseName.'_im.png '.$tempBaseName.'_out.png ');
|
||
exec($cmd);
|
||
$im = imagecreatefrompng($tempBaseName.'_out.png');
|
||
unlink($tempBaseName.'_im.png');
|
||
unlink($tempBaseName.'_cpImg.png');
|
typo3_src-3.8.0beta2.1/t3lib/class.t3lib_stdgraphic.php 2005-04-25 00:03:04.000000000 +0200 | ||
---|---|---|
var $gifExtension = 'gif'; // This should be changed to 'png' if you want this class to read/make PNG-files instead!
|
||
var $TTFLocaleConv = ''; // Used to recode input to TTF-functions for other charsets.
|
||
var $enable_typo3temp_db_tracking = 0; // If set, then all files in typo3temp will be logged in a database table. In addition to being a log of the files with original filenames, it also serves to secure that the same image is not rendered simultaneously by two different processes.
|
||
var $imageMagickPath = ''; // path to imageMagick, eg: /usr/lib/
|
||
var $imageFileExt = 'gif,jpg,jpeg,png,tif,bmp,tga,pcx,ai,pdf'; // Commalist of file extensions perceived as images by TYPO3. List should be set to 'gif,png,jpeg,jpg' if IM is not available. Lowercase and no spaces between!
|
||
var $webImageExt = 'gif,jpg,jpeg,png'; // Commalist of web image extensions (can be shown by a webbrowser)
|
||
var $maskNegate = ''; // Will be ' -negate' if ImageMagick ver 5.2+. See init();
|
||
... | ... | |
$this->enable_typo3temp_db_tracking = $gfxConf['enable_typo3temp_db_tracking'];
|
||
}
|
||
$this->imageMagickPath = $gfxConf['im_path'];
|
||
$this->imageFileExt = $gfxConf['imagefile_ext'];
|
||
// This should be set if ImageMagick ver. 5+ is used.
|
||
... | ... | |
function imageMagickIdentify($imagefile) {
|
||
if (!$this->NO_IMAGE_MAGICK) {
|
||
$frame = $this->noFramePrepended?'':'[0]';
|
||
$cmd = $this->imageMagickPath.'identify '.$this->wrapFileName($imagefile).$frame;
|
||
$cmd = t3lib_div::imageMagickCommand('identify', $this->wrapFileName($imagefile).$frame);
|
||
exec($cmd, $returnVal);
|
||
$splitstring=$returnVal[0];
|
||
$this->IM_commands[] = Array ('identify',$cmd,$returnVal[0]);
|
||
... | ... | |
*/
|
||
function imageMagickExec($input,$output,$params) {
|
||
if (!$this->NO_IMAGE_MAGICK) {
|
||
$cmd = $this->imageMagickPath.'convert '.$params.' '.$this->wrapFileName($input).' '.$this->wrapFileName($output);
|
||
$cmd = t3lib_div::imageMagickCommand('convert', $params.' '.$this->wrapFileName($input).' '.$this->wrapFileName($output));
|
||
$this->IM_commands[] = Array ($output,$cmd);
|
||
$ret = exec($cmd);
|
||
... | ... | |
*/
|
||
function combineExec($input,$overlay,$mask,$output) {
|
||
if (!$this->NO_IMAGE_MAGICK) {
|
||
$cmd = $this->imageMagickPath.$this->combineScript.' -compose over '.$this->wrapFileName($input).' '.$this->wrapFileName($overlay).' '.$this->wrapFileName($mask).' '.$this->wrapFileName($output);
|
||
$cmd = t3lib_div::imageMagickCommand('combine', '-compose over '.$this->wrapFileName($input).' '.$this->wrapFileName($overlay).' '.$this->wrapFileName($mask).' '.$this->wrapFileName($output));
|
||
$this->IM_commands[] = Array ($output,$cmd);
|
||
$ret = exec($cmd);
|
typo3_src-3.8.0beta2.1/t3lib/thumbs.php 2005-04-25 02:18:22.000000000 +0200 | ||
---|---|---|
} else {
|
||
$colors = ($sizeMax>56)?'-colors 64':'-colors 16';
|
||
}
|
||
$cmd = ($TYPO3_CONF_VARS['GFX']['im_path_lzw'] ? $TYPO3_CONF_VARS['GFX']['im_path_lzw'] : $TYPO3_CONF_VARS['GFX']['im_path']).
|
||
'convert -sample '.$this->size.' '.$colors.' '.$this->wrapFileName($this->input.'[0]').' '.$this->wrapFileName($this->output);
|
||
// echo $cmd;
|
||
$path = $TYPO3_CONF_VARS['GFX']['im_path_lzw'] ? $TYPO3_CONF_VARS['GFX']['im_path_lzw'] : $TYPO3_CONF_VARS['GFX']['im_path'];
|
||
$parameters = '-sample '.$this->size.' '.$colors.' '.$this->wrapFileName($this->input.'[0]').' '.$this->wrapFileName($this->output);
|
||
$cmd = t3lib_div::imageMagickCommand('convert', $parameters);
|
||
exec($cmd);
|
||
if (!@file_exists($this->output)) {
|
||
$this->errorGif('No thumb','generated!',basename($this->input));
|