[TYPO3-dev] How to use Image-Object for higher resolutions ?

Stefan Geith typo3dev2008.nospam1 at geithware.de
Thu May 21 12:20:57 CEST 2009


Stefan Geith schrieb:
> ...
> Is this possible with cObj->IMAGE ?
> 
> If not: maybe new TS-parameters for IMAGE would make sense:
>   - image.file.noRescale=1 ==> doesnt rescale the image
>          with ImageMagick, but simply calculates the
>          height/width-Parameters of the image-Tag
>   - image.file.resolution=n ==> rescales image n-time
>          bigger than used by height/width-Parameters

I intended something like this:

function cImage($file,$conf) {
     $info = $this->getImgResource($file,$conf['file.']);
     $GLOBALS['TSFE']->lastImageInfo=$info;
     if (is_array($info))    {
         ...

+       $myImgFile = $conf['file.']['noRescale'] ? $info['origFile'] : 
$info[3];
+       $myWidth = intval($conf['file.']['resolution']) ? $info[0] / 
intval($conf['file.']['resolution']) : $info[0];
+       $myHeight = intval($conf['file.']['resolution']) ? $info[1] / 
intval($conf['file.']['resolution']) : $info[1];
+
-       $theValue = '<img 
src="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.t3lib_div::rawUrlEncodeFP($info[3])).'" 
width="'.$info[0].'" 
height="'.$info[1].'"'.$this->getBorderAttr('border="'.intval($conf['border']).'"').(($conf['params'] 
|| is_array($conf['params.']))?' 
'.$this->stdwrap($conf['params'],$conf['params.']):'').($altParam).' />';
+       $theValue = '<img 
src="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.t3lib_div::rawUrlEncodeFP($myImgFile)).'" 
width="'.$myWidth.'" 
height="'.$myHeight.'"'.$this->getBorderAttr('border="'.intval($conf['border']).'"').(($conf['params'] 
|| is_array($conf['params.']))?' 
'.$this->stdwrap($conf['params'],$conf['params.']):'').($altParam).' />';


/Stefan




More information about the TYPO3-dev mailing list