Project

General

Profile

Feature #22001 ยป imgRessourceParams2.diff

Administrator Admin, 2010-01-20 21:34

View differences:

typo3_src-4.3.1a/t3lib/class.t3lib_stdgraphic.php 2010-01-20 14:08:00.000000000 +0100
* @return array [0]/[1] is w/h, [2] is file extension and [3] is the filename.
* @see getImageScale(), typo3/show_item.php, fileList_ext::renderImage(), tslib_cObj::getImgResource(), SC_tslib_showpic::show(), maskImageOntoImage(), copyImageOntoImage(), scale()
*/
function imageMagickConvert($imagefile,$newExt='',$w='',$h='',$params='',$frame='',$options='',$mustCreate=0) {
function imageMagickConvert($imagefile,$newExt='',$w='',$h='',$params='',$frame='',$options='',$mustCreate=0,$params2='') {
if ($this->NO_IMAGE_MAGICK) {
// Returning file info right away
return $this->getImageDimensions($imagefile);
......
// if no convertion should be performed
$wh_noscale = (!$w && !$h) || ($data[0]==$info[0] && $data[1]==$info[1]); // this flag is true if the width / height does NOT dictate the image to be scaled!! (that is if no w/h is given or if the destination w/h matches the original image-dimensions....
if ($wh_noscale && !$data['crs'] && !$params && !$frame && $newExt==$info[2] && !$mustCreate) {
if ($wh_noscale && !$data['crs'] && !$params && !$params2 && !$frame && $newExt==$info[2] && !$mustCreate) {
$info[3] = $imagefile;
return $info;
}
......
$GLOBALS['TEMP_IMAGES_ON_PAGE'][] = $output;
if ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output, $imagefile)) {
$this->imageMagickExec($imagefile, $output, $command, $frame);
$this->imageMagickExec($imagefile, $output, $command, $frame, $params2);
}
if (file_exists($output)) {
$info[3] = $output;
......
* @param string Refers to which frame-number to select in the image. '' or 0 will select the first frame, 1 will select the next and so on...
* @return string The result of a call to PHP function "exec()"
*/
function imageMagickExec($input,$output,$params,$frame = 0) {
function imageMagickExec($input,$output,$params,$frame = 0,$params2='') {
if (!$this->NO_IMAGE_MAGICK) {
$frame = $frame ? '['.intval($frame).']' : '';
$cmd = t3lib_div::imageMagickCommand('convert', $params.' '.$this->wrapFileName($input).$frame.' '.$this->wrapFileName($output));
$cmd = t3lib_div::imageMagickCommand('convert', $params.' '.$this->wrapFileName($input).$frame.' '.$params2.' '.$this->wrapFileName($output));
$this->IM_commands[] = array($output,$cmd);
$ret = exec($cmd);
typo3_src-4.3.1a/typo3/sysext/cms/tslib/class.tslib_content.php 2010-01-20 13:48:24.000000000 +0100
$temp_ext=$gifCreator->gifExtension;
}
$tempFileInfo = $gifCreator->imageMagickConvert($theImage,$temp_ext,$fileArray['width'],$fileArray['height'],$fileArray['params'],$fileArray['frame'],$options);
$tempFileInfo = $gifCreator->imageMagickConvert($theImage,$temp_ext,$fileArray['width'],$fileArray['height'],$fileArray['params'],$fileArray['frame'],$options,0,$fileArray['params2']);
if (is_array($tempFileInfo)) {
$m_bottomImg = $maskImages['m_bottomImg'];
if ($m_bottomImg) {
......
$GLOBALS['TSFE']->tmpl->fileCache[$hash]= $gifCreator->getImageDimensions($dest);
} else { // Normal situation:
$fileArray['params'] = $this->modifyImageMagickStripProfileParameters($fileArray['params'], $fileArray);
$GLOBALS['TSFE']->tmpl->fileCache[$hash]= $gifCreator->imageMagickConvert($theImage,$fileArray['ext'],$fileArray['width'],$fileArray['height'],$fileArray['params'],$fileArray['frame'],$options);
$GLOBALS['TSFE']->tmpl->fileCache[$hash]= $gifCreator->imageMagickConvert($theImage,$fileArray['ext'],$fileArray['width'],$fileArray['height'],$fileArray['params'],$fileArray['frame'],$options,0,$fileArray['params2']);
if (($fileArray['reduceColors'] || ($imgExt=='png' && !$gifCreator->png_truecolor)) && is_file($GLOBALS['TSFE']->tmpl->fileCache[$hash][3])) {
$reduced = $gifCreator->IMreduceColors($GLOBALS['TSFE']->tmpl->fileCache[$hash][3], t3lib_div::intInRange($fileArray['reduceColors'], 256, $gifCreator->truecolorColors, 256));
if (is_file($reduced)) {
    (1-1/1)