Index: t3lib/class.t3lib_stdgraphic.php =================================================================== --- t3lib/class.t3lib_stdgraphic.php (revision 8444) +++ t3lib/class.t3lib_stdgraphic.php (working copy) @@ -2326,72 +2326,70 @@ } } } - if (t3lib_div::inList($this->imageFileExt,$newExt)) { - if (strstr($w.$h, 'm')) {$max=1;} else {$max=0;} + $max = (strstr($w.$h, 'm')) ? 1 : 0; - $data = $this->getImageScale($info,$w,$h,$options); - $w=$data['origW']; - $h=$data['origH']; + $data = $this->getImageScale($info,$w,$h,$options); + $w=$data['origW']; + $h=$data['origH']; - // 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 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) { - $info[3] = $imagefile; - return $info; - } - $info[0]=$data[0]; - $info[1]=$data[1]; + if ($wh_noscale && !$data['crs'] && !$params && !$frame && $newExt==$info[2] && !$mustCreate) { + $info[3] = $imagefile; + return $info; + } + $info[0]=$data[0]; + $info[1]=$data[1]; - $frame = $this->noFramePrepended ? '' : intval($frame); + $frame = $this->noFramePrepended ? '' : intval($frame); - if (!$params) { - $params = $this->cmds[$newExt]; - } + if (!$params) { + $params = $this->cmds[$newExt]; + } - // Cropscaling: - if ($data['crs']) { - if (!$data['origW']) { $data['origW'] = $data[0]; } - if (!$data['origH']) { $data['origH'] = $data[1]; } - $offsetX = intval(($data[0] - $data['origW']) * ($data['cropH']+100)/200); - $offsetY = intval(($data[1] - $data['origH']) * ($data['cropV']+100)/200); - $params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$offsetX.'+'.$offsetY.' '; - } + // Cropscaling: + if ($data['crs']) { + if (!$data['origW']) { $data['origW'] = $data[0]; } + if (!$data['origH']) { $data['origH'] = $data[1]; } + $offsetX = intval(($data[0] - $data['origW']) * ($data['cropH']+100)/200); + $offsetY = intval(($data[1] - $data['origH']) * ($data['cropV']+100)/200); + $params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$offsetX.'+'.$offsetY.' '; + } - $command = $this->scalecmd.' '.$info[0].'x'.$info[1].'! '.$params.' '; - $cropscale = ($data['crs'] ? 'crs-V'.$data['cropV'].'H'.$data['cropH'] : ''); + $command = $this->scalecmd.' '.$info[0].'x'.$info[1].'! '.$params.' '; + $cropscale = ($data['crs'] ? 'crs-V'.$data['cropV'].'H'.$data['cropH'] : ''); - if ($this->alternativeOutputKey) { - $theOutputName = t3lib_div::shortMD5($command.$cropscale.basename($imagefile).$this->alternativeOutputKey.'['.$frame.']'); - } else { - $theOutputName = t3lib_div::shortMD5($command.$cropscale.$imagefile.filemtime($imagefile).'['.$frame.']'); - } - if ($this->imageMagickConvert_forceFileNameBody) { - $theOutputName = $this->imageMagickConvert_forceFileNameBody; - $this->imageMagickConvert_forceFileNameBody=''; - } + if ($this->alternativeOutputKey) { + $theOutputName = t3lib_div::shortMD5($command.$cropscale.basename($imagefile).$this->alternativeOutputKey.'['.$frame.']'); + } else { + $theOutputName = t3lib_div::shortMD5($command.$cropscale.$imagefile.filemtime($imagefile).'['.$frame.']'); + } + if ($this->imageMagickConvert_forceFileNameBody) { + $theOutputName = $this->imageMagickConvert_forceFileNameBody; + $this->imageMagickConvert_forceFileNameBody=''; + } - // Making the temporary filename: - $this->createTempSubDir('pics/'); - $output = $this->absPrefix.$this->tempPath.'pics/'.$this->filenamePrefix.$theOutputName.'.'.$newExt; + // Making the temporary filename: + $this->createTempSubDir('pics/'); + $output = $this->absPrefix.$this->tempPath.'pics/'.$this->filenamePrefix.$theOutputName.'.'.$newExt; - // Register temporary filename: - $GLOBALS['TEMP_IMAGES_ON_PAGE'][] = $output; + // Register temporary filename: + $GLOBALS['TEMP_IMAGES_ON_PAGE'][] = $output; - if ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output, $imagefile)) { - $this->imageMagickExec($imagefile, $output, $command, $frame); + if ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output, $imagefile)) { + $this->imageMagickExec($imagefile, $output, $command, $frame); + } + if (file_exists($output)) { + $info[3] = $output; + $info[2] = $newExt; + if ($params) { // params could realisticly change some imagedata! + $info=$this->getImageDimensions($info[3]); } - if (file_exists($output)) { - $info[3] = $output; - $info[2] = $newExt; - if ($params) { // params could realisticly change some imagedata! - $info=$this->getImageDimensions($info[3]); - } - if ($info[2]==$this->gifExtension && !$this->dontCompress) { - t3lib_div::gif_compress($info[3],''); // Compress with IM (lzw) or GD (rle) (Workaround for the absence of lzw-compression in GD) - } - return $info; + if ($info[2]==$this->gifExtension && !$this->dontCompress) { + t3lib_div::gif_compress($info[3],''); // Compress with IM (lzw) or GD (rle) (Workaround for the absence of lzw-compression in GD) } + return $info; } } } @@ -2405,8 +2403,8 @@ */ function getImageDimensions($imageFile) { preg_match('/([^\.]*)$/',$imageFile,$reg); - if (file_exists($imageFile) && t3lib_div::inList($this->imageFileExt,strtolower($reg[0]))) { - if ($returnArr = $this->getCachedImageDimensions($imageFile)) { + if (file_exists($imageFile)) { + if ($returnArr = $this->getCachedImageDimensions($imageFile)) { return $returnArr; } else { if ($temp = @getImageSize($imageFile)) {