I am uploading some images to my webpage and would like their thumbnails to be squares cropped from the centre. I am using Codeigniter and gd2.
Here is my code so far:
$config['image_library'] = 'gd2';
$config['source_image'] = $this->userlibrary->picturesdir . $newfilename;
$config['new_image'] = $this->userlibrary->thumbsdir;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width']= 150;
$config['height']= 150;
The images are scaled nicely but they maintain their aspect ratio and only their width OR height gets set to 150, they are not cropped.
Setting maintain_ratio
will still not crop the image but skew it instead.
How could I do this?