我正在尝试调整图像大小和旋转图像。
目前它只是调整图像大小,而不是旋转它。
这是代码,希望有人有解决方案或其他东西:-)
$config['image_library'] = 'gd2';
$config['source_image'] = $data['full_path'];
$config['new_image'] = $data['file_path'].'thumbs/'.$data['file_name'];
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 235;
$config['height'] = 235;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$this->image_lib->clear();
$config['create_thumb'] = FALSE; //No thumbnail
$config['source_image'] = $data['file_path'].'thumbs/'.$data['file_name']; //full path for the source image
$config['rotation_angle'] = '180';//
$this->load->library('image_lib',$config);
//Rotate the image
$this->image_lib->rotate();