Index: class.t3lib_stdgraphic.php =================================================================== --- class.t3lib_stdgraphic.php (revision 2018) +++ class.t3lib_stdgraphic.php (working copy) @@ -2166,8 +2166,15 @@ $params = $this->cmds[$newExt]; } - $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].'! '; + // Cropscaling: (PATCH)) + if ($data['crs']) { + $ofX = intval(($data[0] - $data['origW']) * ($data['cropH']+100)/200); + $ofY = intval(($data[1] - $data['origH']) * ($data['cropV']+100)/200); + $params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$ofX.'+'.$ofY.'! '; + } + $command .= $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); @@ -2186,32 +2193,7 @@ // Register temporary filename: $GLOBALS['TEMP_IMAGES_ON_PAGE'][] = $output; - // Cropscaling: - if ($data['crs']) { - if ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output, $imagefile)) { - $crsOutput = str_replace('pics/', 'pics/crs-', $output); - $this->imageMagickExec($imagefile.$frame, $crsOutput, $command); - $gifCreator = t3lib_div::makeInstance('tslib_gifbuilder'); - $gifCreator->init(); - if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'] !== 0) { - if (!$data['origW']) { $data['origW'] = $data[0]; } - if (!$data['origH']) { $data['origH'] = $data[1]; } - $ofX = intval(($data['origW'] - $data[0]) * ($data['cropH']+100)/200); - $ofY = intval(($data['origH'] - $data[1]) * ($data['cropV']+100)/200); - $tmpParm = Array('XY' => intval($data['origW']).','.intval($data['origH']), - '10' => 'IMAGE', - '10.' => array('file'=> $crsOutput, 'offset'=> $ofX.','.$ofY), - ); - $gifCreator->start($tmpParm, array()); - $newoutput = $gifCreator->gifBuild(); - if (!copy($newoutput,$output)) { - $output = $newoutput; - } - } else { - $output = $crsOutput; - } - } - } elseif ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output,$imagefile)) { + if ($this->dontCheckForExistingTempFile || !$this->file_exists_typo3temp_file($output, $imagefile)) { $this->imageMagickExec($imagefile.$frame,$output,$command); } if (@file_exists($output)) {