Reputation: 820
I want to generate a square thumbnail from a sourceimage for a TYPO3 gallery extension, but I don't find a way to do this. It can be a square section from the source image.
To decrease the image proportional to an thumbnail, i use the following function:
function generateImg($w,$h,$fname,$dir,$class,$id){
$imgTSConfig = array();
$imgTSConfig['file'] = $dir.'/'.$fname;
$imgTSConfig['file.']['maxW'] = $w;
$imgTSConfig['file.']['maxH'] = $h;
$imgTSConfig['stdWrap.']['addParams.']['class'] = $cl;
$imgTSConfig['stdWrap.']['addParams.']['id'] = $id;
$timg = $this->cObj->image($imgTSConfig);
return($timg);
}
Upvotes: 1
Views: 293