[Typo3-dev] Resizing images for different views

Jan Kutschera jan at k-production.de
Sat Jan 29 15:59:07 CET 2005


Hallo, I try to reconfigure the new login box. And i would like to have the
images in list and singleview. So far no problem. But, what I would like is
to rescale the image. In the lsit view it should be rescaled to a smaller
size and in the single view to a mid size. Tham it should be clickable in
the single view to show the original size in a popup.

My Problem is, that I don't know how to resize the image, and how to make a
different between the single and the list output.

So here is what I have in getFieldcontent function:

                                           case 'image' :
                                              $imgArr =
t3lib_div::trimExplode(',',$this->internal['currentRow']['image'],1);
 
$GLOBALS['TSFE']->make_seed();
                                                $randval =
intval(rand(0,count($imgArr)-1));
                                                $imgFile =$imgArr[$randval];
                                                if (($imgArr[$randval] !=
'')&& (file_exists(PATH_site.'uploads/tx_srfeuserregister/'.$imgFile)) ) {

                                                        $imgInfo =
getimagesize(PATH_site.'uploads/tx_srfeuserregister/'.$imgFile);

                                                        if
(is_array($imgInfo)) {
	

	

           
              return '<img src="uploads/tx_srfeuserregister/'.$imgFile.'"
alt="'.htmlspecialchars($this->internal['currentRow']['username']).'" />';
                                                        }


Mit freundlichen Grüßen

Jan Kutschera





More information about the TYPO3-dev mailing list