我试图调整用户上传的图像而不裁剪它。为此,我正在使用以下代码。
$config['image_library'] = 'gd2';
$config['source_image'] = './uploads/'.$name.'.jpg';
$config['new_image'] = './uploads/'.$name.'.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
$this->image_lib->resize();
$config['new_image'] = './uploads/'.$name.'.jpg';
$config['width'] = 1000;
$config['height'] = 400;
$this->image_lib->initialize($config);
$this->image_lib->resize();
但问题是它没有给我1000x400的图像尺寸。它给了我尺寸为 534x400 的图像。有没有办法克服这个问题?