我想获取使用 Codeigniter 中的图像裁剪库创建的新图像的文件名并将其保存在 mysql 数据库中。
这是我当前的裁剪代码:
$data['x'] = $this->input->post('x1');
$data['y'] = $this->input->post('y1');
$data['w'] = $this->input->post('width');
$data['h'] = $this->input->post('height');
$config['image_library'] = 'gd2';
$config['source_image'] = 'assets/images/supplier_photos/'.$this->input->post('img_file');
$config['create_thumb'] = TRUE;
$config['new_image'] = './assets/images/supplier_photos/crop/'.$this->input->post('img_file');
$config['maintain_ratio'] = FALSE;
$config['width'] = $data['w'];
$config['height'] = $data['h'];
$config['x_axis'] = $data['x'];
$config['y_axis'] = $data['y'];
$this->load->library('image_lib', $config);
if(!$this->image_lib->crop())
{
echo $this->image_lib->display_errors();
}
$this->suppliers_model->update_photos();
现在我想获取创建的新图像的文件名。我怎样才能做到这一点?