-2
我想要获取使用Codeigniter中的图像裁剪库创建的新图像的文件名并将其保存在mysql数据库中。使用Codeigniter的图像裁剪库获取新图像
这是我目前种植代码:
$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();
现在我想创建的新图像的文件名。我怎样才能做到这一点?
你试过了什么?这个问题目前太宽泛无法提供答案。 – vvanasten
请检查,我更新的问题,并包括代码。谢谢! – nards
它看起来像你的'$ config'数组已经有'new_image'设置为'./assets/images/supplier_photos/crop /'.$ this-> input-> post('img_file')'。该文件出现在那里?你有什么错误吗? – vvanasten