我正在尝试将上传的图像从 Codeigniter 面板调整到服务器的大小,在此过程中,当我尝试覆盖图像时,我得到一个黑色背景,其中包含调整大小的图像(附加图像),请帮助我
我的代码如下:
move_uploaded_file($_FILES['img']['tmp_name'],"img".".".$extension);
$config['image_library'] = 'gd2';
$config['maintain_ratio'] = TRUE;
$config['create_thumb'] = False;
$config['overwrite'] = TRUE;
$config['width'] = 1000;
$config['height'] = 1000;
$config['quality'] = 100;
$config['source_image'] = "img".".".$extension;
$config['new_image'] = "img".".".$extension;
$this->image_lib->clear();
$this->image_lib->initialize($config);
$this->image_lib->resize();
还有其他方法可以直接获取临时图像并压缩保存吗?
谢谢你,丽贝卡