Project

General

Profile

Feature #20497 » 0011177-noRescale-resolutionFactor.patch

Administrator Admin, 2009-05-24 15:48

View differences:

t3lib/class.t3lib_stdgraphic.php (Arbeitskopie)
$w=$data['origW'];
$h=$data['origH'];
// if no rescale should be performed - means: return original image !!
if ($options['noRescale']) {
$info[0]=$data[0];
$info[1]=$data[1];
$info[3] = $imagefile;
return $info;
}
// 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....
// check, if image should be scaled to a higher resolution as it is displayed by default
$rf = $options['resolutionFactor'];
if ($rf<1) {
$rf = 1;
}
if ($wh_noscale && !$data['crs'] && !$params && !$frame && $newExt==$info[2] && !$mustCreate) {
$info[3] = $imagefile;
return $info;
......
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.' ';
$params .= ' -crop '.($data['origW']*$rf).'x'.($data['origH']*$rf).'+'.($offsetX*$rf).'+'.($offsetY*$rf).' ';
}
$command = $this->scalecmd.' '.$info[0].'x'.$info[1].'! '.$params.' ';
$cropscale = ($data['crs'] ? 'crs-V'.$data['cropV'].'H'.$data['cropH'] : '');
$command = $this->scalecmd.' '.($info[0]*$rf).'x'.($info[1]*$rf).'! '.$params.' ';
$cropscale = ($data['crs'] ? 'crs-V'.($data['cropV']*$rf).'H'.($data['cropH']*$rf) : '');
if ($this->alternativeOutputKey) {
$theOutputName = t3lib_div::shortMD5($command.$cropscale.basename($imagefile).$this->alternativeOutputKey.$frame);
......
$info[2] = $newExt;
if ($params) { // params could realisticly change some imagedata!
$info=$this->getImageDimensions($info[3]);
if ($rf) {
$info[0] = $info[0] / $rf;
$info[1] = $info[1] / $rf;
}
}
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)
typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie)
if ($fileArray['maxH']) {$options['maxH']=$fileArray['maxH'];}
if ($fileArray['minW']) {$options['minW']=$fileArray['minW'];}
if ($fileArray['minH']) {$options['minH']=$fileArray['minH'];}
if ($fileArray['noRescale']) {$options['noRescale']=$fileArray['noRescale'];}
if ($fileArray['resolutionFactor']) {$options['resolutionFactor']=$fileArray['resolutionFactor'];}
// checks to see if m (the mask array) is defined
if (is_array($maskArray) && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {
(1-1/7)