Project

General

Profile

Feature #20497 » 0011177v2-noRescale-resolutionFactor.patch

Administrator Admin, 2009-05-25 10:17

View differences:

t3lib/class.t3lib_stdgraphic.php (Arbeitskopie)
$w=$data['origW'];
$h=$data['origH'];
$resolution = intval($options['resolution']);
if ($resolution>35) {
$rf = $resolution / 72.0;
}
// return original image, if noRescal is set OR if original image is smaller than requested (upscale doesnt make sense ...)
if ($options['noRescale'] || ($resolution>35 && $info[0]<=intval($data[0] * $rf) && $info[1]<=intval($data[1] * $rf))) {
$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....
......
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.' ';
if ($resolution>35) {
$params .= ' -crop '.intval($data['origW']*$rf).'x'.intval($data['origH']*$rf).'+'.intval($offsetX*$rf).'+'.intval($offsetY*$rf).' ';
} else {
$params .= ' -crop '.$data['origW'].'x'.$data['origH'].'+'.$offsetX.'+'.$offsetY.' ';
}
}
if ($resolution>35) {
$params .= ' -density '.$resolution.'x'.$resolution.' ';
$command = $this->scalecmd.' '.intval($info[0]*$rf).'x'.intval($info[1]*$rf).'! '.$params.' ';
$cropscale = ($data['crs'] ? 'crs-V'.intval($data['cropV']*$rf).'H'.intval($data['cropH']*$rf) : '');
} else {
$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 {
......
$info[2] = $newExt;
if ($params) { // params could realisticly change some imagedata!
$info=$this->getImageDimensions($info[3]);
if ($resolution>35) {
$info[0] = intval ($info[0] / $rf);
$info[1] = intval ($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['resolution']) {$options['resolution']=$fileArray['resolution'];}
// checks to see if m (the mask array) is defined
if (is_array($maskArray) && $GLOBALS['TYPO3_CONF_VARS']['GFX']['im']) {
(3-3/7)